2015-02-23 59 views
0

我的服务器最近被盗用。我将所有内容都移到了新服务器上,但由于某种原因,Wordpress网站的永久链接无法正常工作。我查看了所有内容,看起来都是正确的,但是我不明白为什么当这些设置全部从旧服务器上复制过来的时候,这些链接无法工作。WordPress的永久链接不能在新的服务器上工作

服务器的.conf:

<VirtualHost *:80>  
ServerName www.XXX.com 
ServerAdmin [email protected] 
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> 
+0

这些不匹配:'DocumentRoot/var/www/html/XXX.com /'和'' – 2015-02-24 00:16:06

+0

谢谢。修正了这个问题,但永久链接仍然不起作用。 – JustJon 2015-02-24 01:01:13

+0

为什么你有'%{REQUESTFILENAME}'而不是'%{REQUEST_FILENAME}'? – 2015-02-24 04:29:30

回答

0

确保的.htaccess有权权限,使WordPress的可以自行更改。

+0

谢谢。我做到了。 -rw-rw-r-- 1 www-data www-data 235 Feb 23 13:28 .htaccess – JustJon 2015-02-24 00:07:55

相关问题