edit .htaccess

by 12 replies
14
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
#programming #edit #htaccess
  • If no one answers here at WF, you can always be sure to get an answer here, or at stackoverflow.com
    • [1] reply
    • Thanks I will try that.
  • Try this. This should work

    RewriteRule ^become-member/$ /wp-login.php?action=register [NC,L]
    • [1] reply

    • I get this
      Error 404 - Not Found
  • See stack overflow, lots of relevant info there.
  • 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.
    • [1] reply
    • 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?
  • 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]
    • [2] replies
    • Hi klauzer,

      you just try this askapache.com/htaccess/mod_rewrite-tips-and-tricks.html for your doubt about Htaccess mod_rewrite.
    • 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
      • [1] reply

Next Topics on Trending Feed

  • 14

    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