PDA

View Full Version : Multiple RewriteRules for single RewriteCond in .htaccess


sparklywater
06-25-2008, 06:38 PM
Can someone please explain to me how I can make two different Rewriterules work at the same time using a single .htaccess file. For example if I have this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^view_(.*).htm$ view.php?pg=$1

and I also want a similar Rewriterule to work at the same time:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*).html$ local_links.php?cat=$1

When the first part only is put in the .htaccess file, the Rewriterule works, but when I place them both together (with a blank line separating the two), the second Rewriterule does not work.

Please help.

--------------- Added 1214451919 at 1214451919 ---------------

...bump...

Dismounted
06-26-2008, 06:35 AM
Add the condition and rule again (2 conditions and 2 rules).

sparklywater
06-26-2008, 06:54 AM
What do you mean? That's what I said I did...

Dismounted
06-26-2008, 07:27 AM
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^view_(.*).htm$ view.php?pg=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*).html$ local_links.php?cat=$1