Jump to content

excluding


hackalive

Recommended Posts

okay so I have this mod_rewite

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(lib|administration|lib/theme)($|/) - [L]
RewriteRule ^([a-zA-Z0-9]+/)*[a-zA-Z0-9]+$ /index.php?uri=$0

 

now in the directory lib, lib/theme (covered by lib directory) and administration I dont want this reqrite rule to apply I want this one

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+/)*[a-zA-Z0-9]+$ /style.php?css=$0

 

So what am I doing wrong, why is the first one applying even though I am using RewriteRule ^(lib|administration|lib/theme)($|/) - [L]??

 

Any help appreciated

Link to comment
https://forums.phpfreaks.com/topic/203272-excluding/
Share on other sites

Well the starting pattern should look more like...

 

^(lib|administration|lib/theme)/?$

 

Not sure if that will work overall though as I'm not familiar with the use of '-' as the second parameter. I would assume given it's use it's supposed to mean "don't rewrite".

Link to comment
https://forums.phpfreaks.com/topic/203272-excluding/#findComment-1065286
Share on other sites

FYI this is the new code

 

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^(lib|administration)($|/) [L]
RewriteRule ^([a-zA-Z0-9]+/)*[a-zA-Z0-9]+$ /index.php?uri=$0

 

 

and then in the lib directory

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^([a-zA-Z0-9]+/)*[a-zA-Z0-9]+$ /style.php?css=$0

Link to comment
https://forums.phpfreaks.com/topic/203272-excluding/#findComment-1065636
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.