The two rules that conflict with you, the patterns used are exactly the same, which means that in addition to the conditions that apply only to the first rule, these two rules are completely indistinguishable.
Given this url:
http:
Is the " blah " page or user? I canβt say, because the regular expression pattern ( ^([a-z0-9]+)$ ) for both rules corresponds to "blah". So, the first will always apply no matter what. You need to add something to distinguish 2, for example, including a "user" or a "page" in the url:
http://www.site.com/user/blah http://www.site.com/page/bleh
And your rules will look like this:
Options -Indexes RewriteEngine On RewriteCond %(REQUEST_FILENAME) !-f RewriteCond %(REQUEST_FILENAME) !-d RewriteRule ^user/([a-z0-9]+)$ /profile.php?username=$1 [L] RewriteCond %(REQUEST_FILENAME) !-f RewriteCond %(REQUEST_FILENAME) !-d RewriteRule ^page/([a-z0-9]+)$ /display.php?page=$1 [L]
source share