hackalive Posted May 29, 2010 Share Posted May 29, 2010 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 Quote Link to comment Share on other sites More sharing options...
cags Posted May 29, 2010 Share Posted May 29, 2010 Because you only match what the REQUEST_URI starts with, if that is supposed to be the entire value you should use the $ at the end as another anchor. Quote Link to comment Share on other sites More sharing options...
hackalive Posted May 30, 2010 Author Share Posted May 30, 2010 can you alter my code above as an example please cags Quote Link to comment Share on other sites More sharing options...
cags Posted May 30, 2010 Share Posted May 30, 2010 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". Quote Link to comment Share on other sites More sharing options...
hackalive Posted May 31, 2010 Author Share Posted May 31, 2010 anyone else? Quote Link to comment Share on other sites More sharing options...
hackalive Posted May 31, 2010 Author Share Posted May 31, 2010 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 Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 1, 2010 Author Share Posted June 1, 2010 anyone, someone Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 2, 2010 Author Share Posted June 2, 2010 someone has to have an idea Quote Link to comment Share on other sites More sharing options...
hackalive Posted June 4, 2010 Author Share Posted June 4, 2010 anyone? Quote Link to comment Share on other sites More sharing options...
DavidAM Posted June 4, 2010 Share Posted June 4, 2010 I am no expert in rewrite, but if you have the .htaccess in the lib directory with the correct rewrite, I don't think you need to try to exclude it from the rules in the parent directory. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.