有没有用iis6的大神,帮忙看一下这个伪静态规则怎么改
有没有用iis6的大神,帮忙看一下这个伪静态规则怎么改
By 绿眼资源
at 2015-09-15
0人收藏 • 2777人看过
[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
回复#1 @lincanbin :
不行啊,怎么改啊
回复#2 @绿眼资源 :
那就照着那个规则加,把其他参数转发到PHP
回复#3 @lincanbin :
大神,我付费你帮我修改一下吧,实在是不懂
回复#4 @绿眼资源 :
RewriteRule ^(.*)/login(.*) $1/login.php$2 [L] RewriteRule ^(.*)/register(.*) $1/register.php$2 [L]
那也就是对应的两个地方改成这样就是了。
但是我依旧不觉得是Rewrite的问题,因为这两个地方只用到了HTTP的Post menthod,并不需要什么额外的GET参数。
要说共性的话,大概还是跟我之前说的一样,你session的设置出了问题。
回复#5 @lincanbin :
我昨天晚上把session的所有函数检查了一遍
回复#6 @绿眼资源 :
你把common.PHP前面屏蔽错误提示的代码删掉,然后打开错误提示,这样有错误在网页上就可以看出来了。 另外你不详细描述你遇到的错误,我也帮不了你。
回复#7 @lincanbin :
就是伪静态问题,改了那两条规则就好了,谢谢!支付宝聊表心意
回复#8 @绿眼资源 :
已查收,把你名字加捐赠列表里了,感谢支持。