wordPress查看站点时,显示文件目录

1.在wordpress的代码目录中增加.htaccess文件。

 

2.在.htaccess文件中加入如下内容:

DirectoryIndex index.php index.html
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

 

3.在apache的配置文件httpd.conf中:

<Directory "C:/Program Files/Apache SoftwareFoundation/Apache2.2/cgi-bin">
   AllowOverride None
    OptionsNone
    Orderallow,deny
    Allow fromall
</Directory>

AllowOverride None 修改为:AllowOverride All

 

4.重启apache

posted on 2016-06-04 00:54  royhoo  阅读(666)  评论(0编辑  收藏  举报

导航