只要你的主机支持伪静态就可以,在你windows系统的主机的根目录内上传个httpd.ini,如果是linux主机上传的文件是.htaccess,两者不同,以下是适用在windows主机的伪静态规则:把下面的代码保存为httpd.ini就可以
- [ISAPI_Rewrite]
- # 3600 = 1 hour
- CacheClockRate 3600
- RepeatLimit 32
- RewriteCond Host: ^test\.com$
- RewriteRule (.*) http\://www\.test\.com$1 [R,I]
- # Protect httpd.ini and httpd.parse.errors files
- # from accessing through HTTP
- RewriteBase /
- RewriteRule ^(.*\.html.*)$ /index.php/$1 [L]
linux系统下的伪静态规则如下,不过前提条件是要apache或nginx支持伪静态
- RewriteEngine on
- RewriteCond %{http_host} ^test.com [NC]
- RewriteRule ^(.*)$ http://www.test.com/$1 [L,R=301]