问题一:window2003 iis6.0下wordpress根目录下新建的目录和文件都是404,前提是启用了伪静态组件
原因:我们把所有的请求都交给index.php处理了,而本身存在的html和gif等也得经过index.php,但实际中index.php没这方面的功能,所以....问题可以通过修改伪静态规则解决
把
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
删掉换成
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
试一下是不是可以了!
===================================================
问题二:win主机iis,设置了伪静态,根目录下面有/baidu_sitemap.html,但是点击这个链接却无法打开地图页面而是呈现404
有的人只是想解决这一个文件404问题这时只要把伪静态规则中加入
RewriteRule /baidu_sitemap.html /baidu_sitemap.html [L] 即可 解决这一个文件访问出错问题
===================================================
对应问题一:贴一下我在用的规则 isap_rewrite3的兼容httpd.ini的 .htaccess文件(PS:httpd.ini是 isap_rewrite2.x的配置文件)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# Helicon ISAPI_Rewrite configuration file # Version 3.1.0.64 RewriteEngine On RewriteCompatibility2 On RepeatLimit 200 RewriteBase # 中文tag解决 RewriteRule /tag/(.*) /index\.php\?tag=$1 # sitemapxml RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /favicon.ico /favicon.ico [L] RewriteRule /avatar/(.*) /avatar/$1 [L] # For file-based wordpress content (i.e. theme), admin, etc. RewriteRule /wp-(.*) /wp-$1 [L] # For normal wordpress content, via index.php RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] |
对应问题二的规则:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# Helicon ISAPI_Rewrite configuration file # Version 3.1.0.64 RewriteEngine On RewriteCompatibility2 On RepeatLimit 200 RewriteBase # 中文tag解决 RewriteRule /tag/(.*) /index\.php\?tag=$1 # sitemapxml RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /favicon.ico /favicon.ico [L] RewriteRule /baidu_sitemap.html /baidu_sitemap.html [L] # For file-based wordpress content (i.e. theme), admin, etc. RewriteRule /wp-(.*) /wp-$1 [L] # For normal wordpress content, via index.php RewriteRule ^/$ /index.php [L] RewriteRule /(.*) /index.php/$1 [L] |