|
Home > Archive > Apache Server configuration support > January 2007 > Need help with rewrite rule
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Need help with rewrite rule
|
|
|
| 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
| |
| Davide Bianchi 2007-01-28, 7:25 am |
| On 2007-01-28, Lupus <mathieu.maes@gmail.com> wrote:
> 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 ?
Something like
RewriteCond %{REQUEST_URI} !/somepage.php.*$
before your rule.
But if you run a simple google search on this very same newsgroup,
I bet you'll find a thousand of the same problems with solutions.
Davide
--
No, my friends. No, money will never make you happy, and happy will never
make you money. That might be a wisecrack, but I doubt it.
-- Julius Henry "Groucho" Marx (http://en.wikiquote.org/wiki/Groucho_Marx)
|
|
|
|
|