Apache2.4.x和Wordpress

Apache2.4.x和Wordpress,wordpress,apache,Wordpress,Apache,我在使用Apache2.4.x设置Wordpress时遇到一些问题 这是我的情况。 我安装了Wordpress,运行平稳。 我正在尝试将永久链接从普通选项(www.whater.com/?p=xyz)更改为帖子名称选项(www.whater.com/sample Post/) .htaccess已创建,Wordpress可以管理/修改它 当我切换到Post name选项时,我可以访问主页,但每隔一页就会出现404错误。我已经检查了配置,在我的apache2.conf中,我看到了以下内容: <

我在使用Apache2.4.x设置Wordpress时遇到一些问题

这是我的情况。 我安装了Wordpress,运行平稳。 我正在尝试将永久链接从普通选项(www.whater.com/?p=xyz)更改为帖子名称选项(www.whater.com/sample Post/)

.htaccess已创建,Wordpress可以管理/修改它

当我切换到Post name选项时,我可以访问主页,但每隔一页就会出现404错误。我已经检查了配置,在我的apache2.conf中,我看到了以下内容:

<Directory /var/www/html>
      Options Indexes
      AllowOverride None
      Require all granted
</Directory>

它起作用了!但是我再也联系不到Wordpress的管理部分了,它一直将我重定向到主页。“AllowOverride all”也是这样做的

编辑:My.htaccess在使用默认配置时为空。 当我切换到Post name时,它会被重写如下:

# 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
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress

我真的不知道在这里该怎么办,有人面临这样的问题吗

通过在我的virtualhost配置中添加第二个目录选项修复:

<VirtualHost *:443>
        DocumentRoot    /var/www/html/mywebsite/
        ServerName      www.whatever.com
        ServerAlias     whatever.com
        <Directory /var/www/html/mywebsite/>
                Options +Indexes +FollowSymLinks
                AllowOverride None
                Require all granted
        </Directory>
SSLCertificateFile /etc/letsencrypt/live/whatever.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/whatever.com/privkey.pem
</VirtualHost>
<Directory /var/www/html/mywebsite/wp-admin/>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted

选项-索引+FollowSymLinks
不允许超限
要求所有授权

您的.htaccess文件中有什么?配置为普通时,它是空的。配置为Post name时:
# 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
<Directory /var/www/html/mywebsite/wp-admin/>
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted