This is a discussion on Need help with rewrite rule within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello all ! I could use some help setting up a rewrite rule. This is what I want to do : the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello all !
I could use some help setting up a rewrite rule. This is what I want to do : the URL http://www.domain.com/2007-001 should lead to www.domain.com/ somepage.php?id=2007-001 This is what I have : <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine on RewriteRule ^([^/]+)/?$ /somepage.php?id=$1 [QSA] [nc] </IfModule> This works if I'm working with a subdir (ie. http://www.domain.com/ subdir/2007-001) where the rewriterule is set inside the subdir and the .php-file is placed in the root. I'd like to remove the subdir, but it doesn't work. Somehow I must add a condition stating that somepage.php must not be redirected, but I honestly don't know how to do this... Can anyone help me ? Regards, Mathew |