Forum Moderators: phranque
My code to redirect to an external link doesn't work, I hope to find some useful suggestion in this place.
I read this post before posting, [webmasterworld.com...] and I hoped that the answer of jdMorgan would helped me, but I think I'm still making something wrong.
This is my .htaccess:
php_flag register_globals 0
rewriteEngine On
# trailing slash fix
rewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
rewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
# www. fix
rewriteCond %{HTTP_HOST} !^www\.
rewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# external redirect
rewriteRule ^www\.example\.com/statistics/$ http:[b]//www.othersite.com/ [R=301,L][/b]
The bold rule doesn't work. I tried putting http:// after ^ and before www\. but still doesn't work.
Basically I want to redirect a folder (statistics/ in my case, that couldn't even exists), to an external url.
Could anyone help me out to solve this?
Thanks in advance.
[edited by: jdMorgan at 1:54 pm (utc) on Sep. 15, 2007]
[edit reason] example.com [/edit]
RewriteRule ^statistics/$ http://www.othersite.com/ [R=301,L]
If you wish to examine the domain name, then use a RewriteCond to test HTTP_HOST as in your other example rule.
Jim
[edited by: jdMorgan at 1:55 pm (utc) on Sep. 15, 2007]