开发者

Strange problem with .htaccess

I'm having a really strange issue with .htaccess - I'm trying to rewrite the domain so it always prepends www to the domain when loaded - this works for about five minutes and then just turns the page blank!?

.htaccess:

RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} !^www.thedomain.co.uk$ [NC]
cRew开发者_StackOverflow中文版riteRule ^(.*)$ http://www.thedomain.co.uk/$1 [L,R=301]

Any ideas?


Firstly, make sure to remove leading "c" in the last line.

Secondly, you should probably escape dots as shown below.

RewriteEngine On
RewriteCond   %{HTTP_HOST}   !^www\.thedomain\.co\.uk$     [NC]
RewriteRule   ^(.*)$         http://www.thedomain.co.uk/$1 [R=301,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜