【发布时间】:2015-08-11 22:52:39
【问题描述】:
我对 Wordpress 中的 wp-config.php 文件有一些疑问。我将文件从 wordpress 安装目录移到 www 目录上方和主文件夹之一中。我关注了this tutorial。在主 wordpress 目录中,我添加了另一个 wp-config.php 文件,其包含路径如下:
<?php
include('/home/www/web55438/files/wp-config.php');
?>
在 files 文件夹中,我还添加了以下 .htaccess 文件。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
#Prevend directory browsing
Options All -Indexes
#Protect files from displaying
<Files wp-config.php>
order allow,deny
deny from all
</Files>
#Protect htaccess file
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
satisfy all
</Files>
我的问题是:这是使用绝对路径处理 wp-config.php 文件的安全方式吗? .htaccess 文件是否配置正确?为了更好的 wordpress 安全性,您会做出哪些改变?
谢谢
【问题讨论】:
标签: wordpress .htaccess server