Forum Moderators: phranque
I'd like to redirect
www.mydomain.com/en/apartments/name.html
to
www.mydomain.com/apartmentpage.php?lang=en&name=name
I tried this:
RewriteRule ^en/apartments/test.html$ /apartment-redirect.php?path=$1
This does the redirect, but the $path isn't passed through. (I was then going to do some php on the $path to get my $lang and $name)
Any suggestions much appreciated!
RewriteRule ^en/apartments/([^.]+)\.html$ /apartment-redirect.php?path=$1 [L]
Note that the following literal period must be escaped; Unescaped periods in regex patterns are tokens meaning "match any single character."
Also, always use the [L] flag unless you have a good reason not to...
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim