ToonMariner Posted December 13, 2006 Share Posted December 13, 2006 Hi People,I need a bit of help with the old rewrite stuff.1st a few questions as to how apache handles the rewrite rules. Is it valid to have multiple rewrite rules?Does it execute the first one that satisfies the regex or does it go through them all?OK here is my situation. I can code the php to handle all the url conversion - not a problem. The issue here is I want the rewite to work only if the specified url is not a directory. I have a admin dir that I do not want rewite to work on - this is where the cms is. The public side of my site is entirely driven from index.php SO every request that is not for a file in the admin directory should go there (apart from images, pdf's that sort of thing.)I have this for handling the requests for acual files RewriteEngine on RewriteRule !\.(gif|jpg|png|css|pdf)$ /index.phpbut fo course this will interfer with the request to '/admindir' and any subsequent requests.I figured something like RewriteEngine on RewriteRule /admindir(.*)? /admindir RewriteRule !\.(gif|jpg|png|css|pdf)$ /index.phpwould be the order of the day but it didn't work.I would really appreciate any help on this guys 'n gals.PS. I am working on a development machine winXP apache 2.0.59. and I could not get this functioning through .htaccess - instead I had to place these settings directly into the <virtualhost> tags of teh httpd.conf file any ideas why that is so would be a real bonus (please note I don't really have a clue how to structure a real .htaccess file!!!!) 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.