【问题标题】:Can't get anything other than a 404 after creating a new wordpress page创建新的 wordpress 页面后,除了 404 之外什么也得不到
【发布时间】:2017-07-24 15:02:38
【问题描述】:

有人可以帮忙吗?

我在 Ubuntu 16.04 上安装了最新的 apache2 和 wordpress。我的问题是我无法在 wordpress 中创建一个新页面,然后可以在我的浏览器中访问它,即 example.net/newpage 我只是得到一个 404,我检查了我的永久链接设置并且它们设置正确。 wordpress 说页面已经创建,我可以在 wordpress 界面中编辑它没有问题,如果它只是保存为草稿,我也可以查看它,一旦我发布我得到一个 404。

我的 wordpress 虚拟主机设置:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        ServerName example.net
        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
                <Directory /var/www/html>
                        Options FollowSymLinks
                        AllowOverride Limit Options FileInfo
                        DirectoryIndex index.php
                        Order allow,deny
                        Allow from all
                </Directory>
                <Directory /var/www/html/wp-content>
                        Options FollowSymLinks
                        Order allow,deny
                        Allow from all
                </Directory>
</VirtualHost>

当我创建新页面然后尝试立即访问它时来自“tail -f /var/log/apache2/access.log”的日志:

$myip - - [24/Jul/2017:16:57:04 +0200] "POST /wp-admin/post.php HTTP/1.1" 302 520 "http://example.net/wp-admin/post-new.php?post_type=page&wp-post-new-reload=true" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0"
$myip - - [24/Jul/2017:16:57:04 +0200] "GET /wp-admin/post.php?post=12&action=edit&message=6 HTTP/1.1" 200 26740 "http://example.net/wp-admin/post-new.php?post_type=page&wp-post-new-reload=true" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0"
$myip - - [24/Jul/2017:16:57:05 +0200] "GET /wp-admin/admin-ajax.php?action=oembed-cache&post=12 HTTP/1.1" 200 382 "http://example.net/wp-admin/post.php?post=12&action=edit" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0"
$myip - - [24/Jul/2017:16:57:08 +0200] "GET /newpage/ HTTP/1.1" 404 507 "http://example.net/wp-admin/post.php?post=12&action=edit" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0"

对于我运行的文件夹和文件权限:

find /var/www/html/ -type d -exec chmod 755 {} \; && find /var/www/html/ -type f -exec chmod 644 {} \;

我已经尝试了所有我能想到的方法,包括设置教程以及从一开始就重新安装 wordpress 和 mysql,但无济于事。

提前致谢!

【问题讨论】:

  • 如果您将设置中的永久链接更改为“普通”会怎样?
  • 然后页面出现在浏览器中
  • 添加了答案。

标签: wordpress apache


【解决方案1】:

来自this 文章,这可能是由于 mod_rewrite 模块未在 Apache 中加载。

【讨论】:

  • 稍微打败你,发现如果我跑了:“a2enmod rewrite”,那么这也修复了它。哇几个小时的痛苦!感谢您的帮助!
猜你喜欢
  • 2017-11-21
  • 2015-01-15
  • 2011-07-08
  • 2021-03-02
  • 2016-06-07
  • 1970-01-01
  • 1970-01-01
  • 2017-07-17
  • 2011-03-25
相关资源
最近更新 更多