.htaccess mod_rewrite not consistent

Here is a sample from my .htaccess file:

RewriteEngine On

RewriteRule ^login/?$           loginregister.php [L]
RewriteRule ^register/?$        loginregister.php [L]
RewriteRule ^member/([^/]*)$    member.php?id=$1 [L]
RewriteRule ^members/?$         members.php [L]
RewriteRule ^membership/?$      membership.php [L]
RewriteRule ^contact/?$         contact.php [L]
RewriteRule ^privacy/?$         privacy.php [L]
RewriteRule ^terms/?$           terms.php [L]

If I visit example.com/login, it loads example.com/loginregister.php.

The same works for member/, members/, membership/ and contact/.

However, I have just added the rules for privacy/ and terms/, and they are not working.

When visiting those two pages I see this error:

Not Found

The requested URL /privacy was not found on this server.
Apache/2.4.10 (Unix) Server at example.com Port 80

However, if I access them directly (/privacy.php or /terms.php), they load fine.

Why are those two rules not working?

Source: apache

Leave a Reply