ilhan
ilhan

Reputation: 8935

How to write two different rules in one .htaccess file?

I want to write these two different rules in one file. How I have to do it?

RewriteEngine On
RewriteCond %{REQUEST_URI} /v0\.3/forum/
RewriteRule ^(.*)$ /v0.3/test.php?forum=$1 [L,QSA]

RewriteEngine On
RewriteCond %{REQUEST_URI} /v0\.3/profile/
RewriteRule ^(.*)$ /v0.3/profiles.php?id=$1 [L,QSA]

Upvotes: 0

Views: 307

Answers (1)

Marek Sebera
Marek Sebera

Reputation: 40621

Simply delete the second RewriteEngine On declaration

RewriteEngine On
RewriteCond %{REQUEST_URI} /v0\.3/forum/
RewriteRule ^(.*)$ /v0.3/test.php?forum=$1 [L,QSA]

RewriteCond %{REQUEST_URI} /v0\.3/profile/
RewriteRule ^(.*)$ /v0.3/profiles.php?id=$1 [L,QSA]

Upvotes: 3

Related Questions