Jump to content

rewriterule help


ToonMariner

Recommended Posts

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.php

but 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.php

would 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!!!!)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.