【问题标题】:Wordpress : URL error 404 but the page existsWordpress:URL 错误 404 但页面存在
【发布时间】:2011-03-15 01:33:45
【问题描述】:

我将我的 wordpress (3.0) 博客移至我的专用服务器。

只有一件事坏了:

如果我将 worpress 中的 url 设置为

http://wwww.example.com/page?id=3

页面显示正确

如果我将 URL 设置为:

http://wwww.example.com/about/
http://www.example.com/services/

它以 404 not found 页面结束!!

如果有帮助,这是我的虚拟主机:

<VirtualHost *:80>
   ServerAdmin webmaster@localhost
   ServerName www.example.fr

    DocumentRoot /var/www/example
    <Directory /var/www/example>
            Options -Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>


    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access-example.log combined
    ErrorLog /var/log/apache2/error-example.log
    ServerSignature Off
</VirtualHost>

谢谢你

【问题讨论】:

  • 听起来像是一个 mod_rewrite 问题 - 你在使用 wordpress 永久链接吗?你签入 .htaccess 文件了吗?

标签: wordpress url-rewriting url-routing http-status-code-404


【解决方案1】:

Wordpress 使用 .htaccess 进行重定向,您是否尝试将 AllowOverride None 指令更改为 AllowOverride All ?

【讨论】:

  • 我刚刚尝试了 AllowOverride All 并且效果很好!非常感谢;)
【解决方案2】:

听起来您的新服务器没有设置为将您的 URL 重写为漂亮的链接。您基本上希望遵循此设置页面上的指南:

http://codex.wordpress.org/Using_Permalinks

【讨论】:

    【解决方案3】:

    我发现除了正确配置的 .htaccess、httpd-vhosts.conf 等之外,需要注意的一件事是检查服务器的 http.conf 中是否启用了 mod_rewrite。只需确保未注释此行:

    LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-18
      • 2012-08-11
      • 2021-11-06
      • 2017-07-07
      • 1970-01-01
      • 1970-01-01
      • 2015-06-22
      相关资源
      最近更新 更多