[wp-hackers] mod rewrite problems

Stefan Hartweg stefan at hartweg.net
Thu May 4 05:59:31 GMT 2006


Thank you. It takes me two days to learn mod rewrite and regular expressions
and 20 minutes to forget it again :-) Just won't stick and if I need it once
in a while I'm lost. Thanks again.

Steve

-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Rabin Vincent
Sent: Thursday, 4 May 2006 3:50 PM
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] mod rewrite problems

On 5/4/06, Stefan Hartweg <stefan at hartweg.net> wrote:
> #the following line should redirect to test.html
> RewriteRule ^/test.html$ /test/test.html

You need to remove the inital "/" in the match rule. That
would be enough to get it working, but you should also
escape the "." to be fully correct. (Regular expressions -
otherwise "testahtml" would also be rewritten).

Also if "test/test.html" is a relative directory, you should
drop the leading slash there too.

What you need is:
RewriteRule ^test\.html$ test/test.html

Rabin
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list