Trouble with rewriterule
am 20.07.2007 18:02:21 von laredotornado
Hi,
I'm using Apache 2.2 on Fedora Core 5 Linux. What I want is if a user
requests a URL with a particular directory name, "subdir1" to rewrite
the URL replacing "subdir1" with "subdir2". So I created
this .htaccess file
RewriteEngine On
RewriteRule subdir1/(.*) subdir2/$1
and placed it in /webroot/. Unfortunately, when I request
http://mydomain.com/subdir1/test20/order_form.php?QuickView= 0&Department=Main
the URL was not rewritten. What is wrong with my .htaccess file?
Thanks, - Dave
Re: Trouble with rewriterule
am 20.07.2007 19:32:02 von Jim Hayter
laredotornado@zipmail.com wrote:
> Hi,
>
> I'm using Apache 2.2 on Fedora Core 5 Linux. What I want is if a user
> requests a URL with a particular directory name, "subdir1" to rewrite
> the URL replacing "subdir1" with "subdir2". So I created
> this .htaccess file
>
> RewriteEngine On
> RewriteRule subdir1/(.*) subdir2/$1
>
> and placed it in /webroot/. Unfortunately, when I request
>
> http://mydomain.com/subdir1/test20/order_form.php?QuickView= 0&Department=Main
>
> the URL was not rewritten. What is wrong with my .htaccess file?
>
> Thanks, - Dave
>
I don't use .htaccess so I'm not sure what your problem is. Have you
tried setting RewriteLogLevel to a non-zero value and examining the
rewrite log? It can be very useful in showing you how the rewrite
process works.
Jim