您的位置:首页 > 其它

【WordPress】404 页面不显示

2015-12-15 17:23 351 查看
    首先, 要弄清楚网站所在的服务器是IIS还是Apache. Apache 上面应该不会有这样的问题。 因为mod_rewrite 在Apache是支持的, IIS 是不支持的。 

WP自己有自己的伪静态规则去处理错误页面。很多主题都带有自带有404错误页面模板。但是当我们输入一个不存在的站内网址之后,浏览器中显示的错误是IIS级别的404错误提示。

这样的问题处理办法: 

登陆WP admin Dashboard---> settings ---> permalinks.

这样做的结果就是在你的web.config 根目录下面加上以下 section: 

<?
xml

version
=
"1.0"

encoding
=
"UTF-8"
?>

    
<
configuration
>

        
<
system.webServer
>

            
<
rewrite
>

                
<
rules
>

                    
<
rule

name
=
"WordPress"

stopProcessing
=
"true"
>

                        
<
match

url
=
"^(.*)$"

/>

                        
<
conditions
>

                            
<
add

input
=
"{REQUEST_FILENAME}"

matchType
=
"IsFile"

negate
=
"true"

/>

                            
<
add

input
=
"{REQUEST_FILENAME}"

matchType
=
"IsDirectory"

negate
=
"true"

/>

                        
</
conditions
>

                        
<
action

type
=
"Rewrite"

url
=
"index.php"

appendQueryString
=
"true"

/>

                    
</
rule
>

            
</
rules
>

        
</
rewrite
>

    
</
system.webServer
>

</
configuration
>


如此, 你的WP就会开始通过IIS rewrite Module 来处理这样的问题了。 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  WordPress 404 theme