Wordpress永久链接不适用于新服务器

时间:2015-02-23 23:54:54

标签: php wordpress .htaccess permalinks

我的服务器最近遭到入侵。我将所有内容都移到了新服务器上,但由于某些原因,Wordpress站点的永久链接无法正常工作。我已经查看了所有内容,但这一切似乎都是正确的,但我无法理解为什么当这些设置全部从旧服务器上复制完毕后链接才能正常工作。< / p>

服务器.conf:

<VirtualHost *:80>    
ServerName www.XXX.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/XXX.com/

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

<VirtualHost *:80>
ServerAlias XXX.com
ServerAdmin XXX
DocumentRoot /var/www/html/XXX.com/
ServerName www.XXX.com
DirectoryIndex index.html index.php
<Directory "/var/www/html/www.XXX.com/">
    allow from all
    Options -Indexes
    AllowOverride All
</Directory>
CustomLog ${APACHELOGDIR}/XXX.log common
ErrorLog ${APACHELOGDIR}/XXX-error.log

</VirtualHost>

htaccess的:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUESTFILENAME} !-f
RewriteCond %{REQUESTFILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

1 个答案:

答案 0 :(得分:0)

确保.htaccess具有正确的权限,以便wordpress可以自行更改。