Adas
Adas

Reputation: 309

More than one rewrite rule

I am trying to use like

www.site.com/somename

from two different pages. and i am using htaccess.

#1st condition
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.+) profile.php?username=$1 [QSA,L]

#2nd condition
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule (.+) clinicprofile.php?profilename=$1 [QSA,L]

It works if i only use for one of above page condition, But when i use both conditions 404 page is showing.

Please try to solve my problem.

Upvotes: 0

Views: 110

Answers (1)

Adas
Adas

Reputation: 309

Thanks to the suggestions, what i have implemented is

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule (.+) profile.php?username=$1 [L]

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^clinic/(.+)$ /clinicprofile.php?profilename=$1 [L]

clinic word need to added.

Upvotes: 1

Related Questions