12 replies
I need to add a code so it shorten my url address to a easier and not /wp?action=register

This is how my .htaccess looks like, underline is added recently and this is what I was informed to add, but this won.t work
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteEngine On
RewriteRule ^become-member/$ /wp-login.php?action=register
</IfModule>

# END WordPress
#edit #htaccess
  • Profile picture of the author Happy_Balance
    If no one answers here at WF, you can always be sure to get an answer here, or at stackoverflow.com
    Signature

    Every Day Is Fun! :)

    {{ DiscussionBoard.errors[3584309].message }}
  • Profile picture of the author phpdev
    Try this. This should work

    RewriteRule ^become-member/$ /wp-login.php?action=register [NC,L]
    Signature
    Ali Usman
    PHP, MySql, WordPress, API Programming, E-Commerce Site, Payment Integration, Twilio, SMS Marketing, Custom Development, Wordpress, Joomla, Interspire, BigCommerce, Volusion, 3dCart and many more...
    sales@bluecomp.net
    {{ DiscussionBoard.errors[3585031].message }}
  • Profile picture of the author teecamo
    See stack overflow, lots of relevant info there.
    {{ DiscussionBoard.errors[3585106].message }}
  • Profile picture of the author SteveJohnson
    You need to switch the sequence of the rulesets, because your member rule will never execute:
    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^become-member/$ /wp-login.php?action=register
    
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    </IfModule>
    
    # END WordPress
    The original rules said,
    #1 if the requested page is for 'index.php', don't rewrite the target, stop processing
    #2 if the requested filename is NOT a file (! -f)
    #3 if the requested filename is NOT a directory (! -d)
    #4 then send whole request to /index.php and stop processing ( [L] )

    EVERY request to a WP site fits one of the above rules - your new one would never even get processed.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3585134].message }}
    • Profile picture of the author klauzer
      Originally Posted by SteveJohnson View Post

      # END WordPress[/code]The original rules said,
      #1 if the requested page is for 'index.php', don't rewrite the target, stop processing
      #2 if the requested filename is NOT a file (! -f)
      #3 if the requested filename is NOT a directory (! -d)
      #4 then send whole request to /index.php and stop processing ( [L] )

      EVERY request to a WP site fits one of the above rules - your new one would never even get processed.
      This is how it looks now
      Code:
      # BEGIN WordPress
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteRule ^become-member/$ /wp-login.php?action=register
      
      RewriteBase /
      RewriteRule ^index.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]
      </IfModule>
      
      
      # END WordPress
      It is now possible to come to the register site but the URL is the same as before /wp-login.php?action=register

      What more do I need change?
      {{ DiscussionBoard.errors[3585173].message }}
  • Profile picture of the author SteveJohnson
    My mistake, sorry. You need to add an [L] flag at the end of your line:
    Code:
    RewriteRule ^become-member/$ /wp-login.php?action=register [L]
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3585201].message }}
    • Profile picture of the author blazedream
      Hi klauzer,

      you just try this askapache.com/htaccess/mod_rewrite-tips-and-tricks.html for your doubt about Htaccess mod_rewrite.
      {{ DiscussionBoard.errors[3585318].message }}
    • Profile picture of the author klauzer
      Thanks everyone

      Originally Posted by SteveJohnson View Post

      My mistake, sorry. You need to add an [L] flag at the end of your line:
      Code:
      RewriteRule ^become-member/$ /wp-login.php?action=register [L]
      I tried that to. Nothing happens stil showing /wp-login.php?action=register in the url bar.

      But don't I need to change some file? For example I have a file that is called wp-signup. In that file I can find /wp-login.php?action=register
      {{ DiscussionBoard.errors[3585830].message }}
      • Profile picture of the author SteveJohnson
        Originally Posted by klauzer View Post

        Thanks everyone

        I tried that to. Nothing happens stil showing /wp-login.php?action=register in the url bar.

        But don't I need to change some file? For example I have a file that is called wp-signup. In that file I can find /wp-login.php?action=register
        I'm afraid that I don't have any other suggestions to give you. It might be that you're getting redirected around by WP itself after you rewrite the login page from the rewrite rule.
        Signature

        The 2nd Amendment, 1789 - The Original Homeland Security.

        Gun control means never having to say, "I missed you."

        {{ DiscussionBoard.errors[3588150].message }}

Trending Topics