求助,IIS6伪静态配置

讨论程序使用中的问题
回复
bzasy
帖子: 7
注册时间: 2015年 7月 1日 11:38

求助,IIS6伪静态配置

帖子 bzasy »

环境IIS6+PHP+MYSQL+ISAPI_Rewrite

规则如下:

代码: 全选

 RewriteRule ^/admin(.*) /admin/$1 [L]
 RewriteRule ^(.*)(html|htm)$ /index\.php/$1$2 [L]
 RewriteRule ^([^.]+)$ /index\.php/$1 [L]
出现的问题:
后台必须要加Index.php才能进去,不加index.php就是404
头像
aneasystone
帖子: 9
注册时间: 2015年 6月 14日 01:55
来自: www.aneasystone.com
联系:

Re: 求助,IIS6伪静态配置

帖子 aneasystone »

你可以试试下面的规则:

代码: 全选

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
bzasy
帖子: 7
注册时间: 2015年 7月 1日 11:38

Re: 求助,IIS6伪静态配置

帖子 bzasy »

aneasystone 写了:你可以试试下面的规则:

代码: 全选

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
用了这个规则直接网页乱码了............,后台也跳转到前台
头像
aneasystone
帖子: 9
注册时间: 2015年 6月 14日 01:55
来自: www.aneasystone.com
联系:

Re: 求助,IIS6伪静态配置

帖子 aneasystone »

这个只是Web服务器的重写规则,应该和乱码没关系的。
另外,除了这个重写规则,你的IIS还有没有做过其他的配置或者其他的重写规则呢?
bzasy
帖子: 7
注册时间: 2015年 7月 1日 11:38

Re: 求助,IIS6伪静态配置

帖子 bzasy »

aneasystone 写了:这个只是Web服务器的重写规则,应该和乱码没关系的。
另外,除了这个重写规则,你的IIS还有没有做过其他的配置或者其他的重写规则呢?
乱码是能出来文字,但是无规则排列,开始设置的删除了再添加的规则,就出现首页无规则排列,然后后台还是404,加上index.php又返回主页了,其他配置倒是没有什么,规则也是按照你发的填上去然后重启IIS
头像
aneasystone
帖子: 9
注册时间: 2015年 6月 14日 01:55
来自: www.aneasystone.com
联系:

Re: 求助,IIS6伪静态配置

帖子 aneasystone »

额,试下WAMP环境吧,看下WAMP环境下可正常?
bzasy
帖子: 7
注册时间: 2015年 7月 1日 11:38

Re: 求助,IIS6伪静态配置

帖子 bzasy »

aneasystone 写了:额,试下WAMP环境吧,看下WAMP环境下可正常?
已经解决,换了规则,全部已无问题,后台什么的都没问题了,
环境是IIS6+MYSQL+PHP+ISAPI_Rewrite 0087破解版
下面贴出伪静态规则,给更多IIS6的同志
ps.今天弄一天伪静态了

代码: 全选

RewriteEngine On
RewriteCompatibility2 On
RepeatLimit 32
RewriteBase 
# unsupported directive:  [ISAPI_Rewrite]
#  3600 = 1 hour
# unsupported directive: CacheClockRate 3600
RewriteRule ^/tag/(.*)$ /index\.php\?tag=$1
RewriteRule ^/sitemap.xml$ /sitemap.xml [L]
RewriteRule ^/favicon.ico$ /favicon.ico [L]
RewriteRule ^/(.*).html$ /index.php/$1.html [L]
RewriteRule ^/(.*)/comment$ /index.php/$1/comment [L]
RewriteRule ^/category/(.*)$ /index.php/category/$1 [L]
RewriteRule ^/page/(.*)$ /index.php/page/$1 [L]
RewriteRule ^/search/(.*)$ /index.php/search/$1 [L]
RewriteRule ^/feed/(.*)$ /index.php/feed/$1 [L]
RewriteRule ^/2(.*)$ /index.php/2$1 [L]
RewriteRule ^/action(.*)$ /index.php/action$1 [L]
上面是规则,这样设置了分类下面的文章是打不开的,其他都没问题,然后进后台把固定链接里面的自定义文章路径修改为按分类归档就好了。
回复