根目录访问php 404,解决wordpress伪静态后根目录下的网页和其他文件访问全部404...

问题一: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的配置文件)

Shell

# 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

20

21

22

# Helicon ISAPI_Rewrite configuration file

# Version 3.1.0.64

RewriteEngineOn

RewriteCompatibility2On

RepeatLimit200

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]

对应问题二的规则:

Shell

# 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]

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

RewriteEngineOn

RewriteCompatibility2On

RepeatLimit200

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]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值