Wordpress永久链接404错误与HTTPS主机

时间:2015-08-03 02:50:37

标签: php wordpress https url-rewriting permalinks

我的新永久链接在我的网站上继续显示404错误,即使在添加AllowOverride和Rewrite模块参数之后也是如此。这是我的default-ssl.conf文件:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>

ServerAdmin vincent.zzz@gmail.com
DocumentRoot /var/www/zzz
ServerName zzz.com.vn
ServerAlias www.zzz.com.vn

<Directory "/var/www/zzz">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
</Directory>

<Location />
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]
    </IfModule>
</Location>     

#end of custon stuff..... 

这是我的apache2.conf文件的正常http部分:

<VirtualHost *:80>
ServerName zzz.com.vn
DocumentRoot /var/www/zzz
<Directory "/var/www/zzz">

    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    DirectoryIndex index.php

    #force SSL
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=permanent]

</Directory>

有人有想法吗?

1 个答案:

答案 0 :(得分:0)

你确定mod_rewrite已启用吗?在/etc/apache2/mods-enabled中是否有一个指向rewrite.load的符号链接? 您可以使用以下命令启用mod:

sudo a2enmod rewrite