有没有用iis6的大神,帮忙看一下这个伪静态规则怎么改
By
绿眼资源
at 2015-09-15 • 0人收藏 • 2791人看过
[ISAPI_Rewrite] CacheClockRate 3600 RepeatLimit 32 # Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP RewriteRule ^(.*)/dashboard $1/dashboard.php RewriteRule ^(.*)/favorites(/page/([0-9]*))? $1/favorites.php\?page=$3 RewriteRule ^(.*)/json/([0-9a-z_\-]+) $1/json.php\?action=$2 RewriteRule ^(.*)/login $1/login.php RewriteRule ^(.*)/manage $1(.*)/manage.php RewriteRule ^(.*)/new $1/new.php RewriteRule ^(.*)/notifications $1/notifications.php RewriteRule ^(.*)/page/([0-9]+) $1/index.php\?page=$2 RewriteRule ^(.*)/register $1/register.php RewriteRule ^(.*)/reply $1/reply.php RewriteRule ^(.*)/robots.txt $1/robots.php RewriteRule ^(.*)/search.xml $1/open_search.php RewriteRule ^(.*)/search/([^/]*)(/page/([0-9]*))? $1/search.php\?keyword=$2&page=$4 RewriteRule ^(.*)/settings $1/settings.php RewriteRule ^(.*)/sitemap-(topics|pages|tags|users|index)(-([0-9]+))?.xml $1/sitemap.php\?action=$2&page=$4 RewriteRule ^(.*)/statistics $1/statistics.php RewriteRule ^(.*)/t/([0-9]+)(-([0-9]*))? $1/topic.php\?id=$2&page=$4 RewriteRule ^(.*)/tag/([^/]*)(/page/([0-9]*))? $1/tag.php\?name=$2&page=$4 RewriteRule ^(.*)/tags/following(/page/([0-9]*))? $1/favorite_tags.php\?page=$3 RewriteRule ^(.*)/u/(.*) $1/user.php\?username=$2 RewriteRule ^(.*)/users/following(/page/([0-9]*))? $1/favorite_users.php\?page=$3 RewriteRule ^(.*)/upload_controller $1/upload_controller.php RewriteRule ^(.*)/view-(desktop|mobile) $1/view.php(.*)\?view=$2 #IIS ErrorDocument #RewriteRule ^/([0-9]{3})\.(php|asp|htm|html)$ /$1\.php
问题:注册和登陆跨页打不开,http://bbs.xxxxx.com/login?
就是问号后面再有页面打不开,估计是伪静态里面没有考虑
参照:我用xiuno bbs也是同样问题,xiuno作者给改了一下伪静态规则,说是他原先没有 考虑这个问题。
xiuno原规则:
[ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 #RewriteRule .*\.(?:gif|jpg|png|css|js|txt|jpeg|swf|flv) $0 [I,L] #RewriteRule /httpd(?:\.ini|\.parse\.errors) / [F,I,O] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/mobile(.*)\.htm /mobile/index.php?$1.htm [L] RewriteRule ^/admin(.*)\.htm /admin/index.php?$1.htm [L] RewriteRule ^(.*)\.htm /index.php?$1.htm [L]
这个规则导致搜索功能不能用
xiuno作者修改后的规则:
[ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 #RewriteRule .*\.(?:gif|jpg|png|css|js|txt|jpeg|swf|flv) $0 [I,L] #RewriteRule /httpd(?:\.ini|\.parse\.errors) / [F,I,O] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/mobile(.*)\.htm(.*) /mobile/index.php?$1.htm$2 [L] RewriteRule ^/admin(.*)\.htm(.*) /admin/index.php?$1.htm$2 [L] RewriteRule ^(.*)\.htm(.*) /index.php?$1.htm$2 [L]
我不懂代码不知道是不是同一个问题,求大神帮忙改改,谢谢!
9 个回复 | 最后更新于 2015-09-15
登录后方可回帖
直接用.htaccess里的规则。