[提问]
关于.hateeass文件的规则设置问题
|
|
我的文件里有3条规则,301重定向-生成伪静态和绑定子目录3个规则,怎么写啊,因为前2个可以同时写在文件里,但是第三个绑定跟目录就无效,怎么写才是正则表达式,望大家指正:
这个是301重定向
RewriteEngine On
RewriteCond %{HTTP_HOST} !^sXXX.com$ [NC]
RewriteRule ^(.*)$ 链接:http://www.xxx.com/ (http://www.xxx.com/)$1 [L,R=301]
这个是伪静态设置
RewriteEngine On
RewriteRule ^plus/list-([0-9]+)\.html$ /plus/list.php?tid=$1
RewriteRule ^plus/list-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3
RewriteRule ^plus/view-([0-9]+)-1\.html$ /plus/view.php?arcID=$1
RewriteRule ^plus/view-([0-9]+)-([0-9]+)\.html$ /plus/view.php?aid=$1&pageno=$2
这个是绑定网站根目录的规则,但是和上面两个一起用的话,就无效了
DirectoryIndex default.php index.htm index.php index.html default.htm default.html index.shtml default.shtml
RewriteEngine On
Options All -Indexes
php_value upload_max_filesize 20M
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.) ?XXX.com$
RewriteCond %{REQUEST_URI} !^/cqybzs/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /cqybzs/$1
RewriteCond %{HTTP_HOST} ^(www.)? XXX.com$
RewriteRule ^(/)?$ cqybzs/index.php [L]
ErrorDocument 401 /404.htm
ErrorDocument 403 /404.htm
ErrorDocument 404 /404.htm
ErrorDocument 500 /404.htm |
|
|
|
|
|
|
|
|
|
|
微微百科
发表于 2011-8-11 10:40:42
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
nowwz88
发表于 2011-8-11 10:49:09
|
显示全部楼层
回复 2# 的帖子
|
要是不能叠加的话怎么办,能弄2个.hateeass文件吗 |
|
|
|
|
|
|
|
|
|
|
微微百科
发表于 2011-8-11 10:51:25
|
显示全部楼层
|
同一个目录中,应该是不能共存二个.htaccess文件的。 |
|
|
|
|
|
|
|
|
|
|
nowwz88
发表于 2011-8-11 11:23:27
|
显示全部楼层
回复 4# 的帖子
|
那么我想学习下.htaccess的相关知识,能否给我介绍个网站,他的全称是什么 |
|
|
|
|
|
|
|
|
|
|
微微百科
发表于 2011-8-11 11:46:38
|
显示全部楼层
http://www.zzbaike.com/wiki/Htaccess
你可以去这里看一下 |
|
|
|
|
|
|
|
|