开发者

regex .htaccess

I want to redirect a do开发者_StackOverflow社区main newspaper.com and newspapereds.com to news.com. The rewrite I am using is

RewriteRule [paper] http://www.news.com. The problem is it does not redirect.

Thanks Jean


RewriteRule will only try to match the pattern agains the URL path but not the host part. You need to use RewriteCond instead:

RewriteCond %{HTTP_HOST} paper
RewriteRule ^ http://www.news.com

Besides that, [paper] is a character class and matches only one occurrence of the containing characters p, a, e, and r.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜