htaccess的规则重定向非万维网到www - 的Litespeed服务器万维网、重定向、规则、服务器

2023-09-02 09:45:21 作者:毕业时可以抱你么

我有一个关于我的Litespeed服务器使用htaccess的问题。我试过 http://domain.com http://www.domain.com 使用这个法则来重定向

I have a question about using htaccess in my litespeed server. I tried to redirect http://domain.com to http://www.domain.com using this rule:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule .* http://www.domain.com/ [L,R=301]

当我检查 http://domain.com 使用Xenu,结果如下:

When I check http://domain.com using Xenu, the result is as follow:

http://domain.com/   200 ok text/html 301 Moved Permanently 
http://domain.com/%s  200 ok text/html 301 Moved Permanently  
http://www.litespeedtech.com/ 200 ok text/html LiteSpeed Web Server 
http://www.domain.com/         200 ok text/html redir 

我不知道我是否有不正确的htaccess规则或这是因为在的Litespeed的bug?我已搜查任何地方几个小时...谢谢

I wonder whether I had incorrect htaccess rule or this is because of bug in litespeed? I have searched anywhere for hours...Thanks

推荐答案

@mipadi: 我想这是不是301重定向(是吗?)。以下是我得到了Xenu:

@mipadi: I guess it is not 301 redirected (or is it?). Here is what I got from Xenu:

http://domain.com/   200 ok text/html Homepage
http://cdn.domain.com/css/style.css  200 ok text/css
http://www.domain.com/about/         200 ok text/html About
http://www.domain.com/contact/         200 ok text/html Contact