我希望能够重定向此网址:
www.shorturl.co.uk/answers
到此网址:
http://actual.url.co.uk/answers.html
我在.htaccess中尝试了以下内容,但它似乎没有起作用:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.shorturl\.co.uk$ [NC]
RewriteRule ^answers$ http://actual.url.co.uk/answers.html [L,R=301,NC]
有谁可以指出我可能出错的地方?感谢
答案 0 :(得分:0)
我不是这方面的专家,但你可以尝试一下:
RewriteCond %{HTTP_HOST} ^www\.shorturl\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^shorturl\.co\.uk$
RewriteRule ^answers$ http://actual.url.co.uk/answers.html [R=301,L]