ISPAI重写301在Windows Server上重定向/ SEO URL规范化

时间:2012-12-18 11:12:18

标签: redirect isapi-rewrite canonical-link

我是初次使用Windows服务器并且已经知道它是为ISPAI重写设置的。

我尝试过创建一个httpd.ini文件和一个带有可能重定向的.conf文件,但没有任何工作。

有人可以告诉我如何创建正确的文件,然后重写以下内容:

http://aspectexhibitions.co.uk/

应重定向到:

http://www.aspectexhibitions.co.uk/

-

http://www.aspectexhibitions.co.uk/index.php http://aspectexhibitions.co.uk/index.php

应重定向到:

http://www.aspectexhibitions.co.uk/

1 个答案:

答案 0 :(得分:0)

完成...

[ISAPI_Rewrite]

#Redirect Non WWW to WWW
RewriteEngine on

RewriteCond %{HTTPS} (on)?
RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]

#Redirect index.php to root
RewriteEngine on
RewriteBase /

RewriteRule ^index\.php$ http://www.aspectexhibitions.co.uk/ [NC,R=301,L]