Wordpress 永久链接到达 apache 404,而不是 wordpress 404.php 或它们各自的实际页面。重定向或 apache 配置错误?

Wordpress 永久链接到达 apache 404,而不是 wordpress 404.php 或它们各自的实际页面。重定向或 apache 配置错误?

我刚刚清理了 wordpress 安装并设置了它的 .htaccess,正如他们说的那样:

http://codex.wordpress.org/Using_Permalinks

# 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

当我尝试在浏览器中访问某个地址时,http://localhost:888/blog/服务器会给出 404 错误。我甚至无法通过 wordpress 转到 wordpess 自己的 404 页面。

当我查看我的网站的错误日志时:

[Sat Apr 20 10:43:36 2013] [error] [client 127.0.0.1] File does not exist: /home/alan/projects/pin_wp/blog, referer: http://localhost:888/

所以这让我认为我已经在某个地方弄乱了我的虚拟主机配置 - 因为我是该领域的一个大菜鸟:

alan@alan:~/projects/pin_wp$ cat /etc/apache2/sites-enabled/localhost-pinwp 
Listen 888
<VirtualHost *:888>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/alan/projects/pin_wp
    ServerName html

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /home/alan/projects/pin_wp>
        Options Indexes FollowSymLinks MultiViews +Includes
        AllowOverride None
        Order allow,deny
        allow from all
        AddOutputFilter INCLUDES .html
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error-pinwp.log

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

    CustomLog ${APACHE_LOG_DIR}/access-pinwp.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

有人能帮我解决这个问题并指出我这次犯了什么愚蠢的错误吗?

艾伦

答案1

好吧,我在很少帮助下就明白了。

我改变了 apache 配置:

<Directory /home/alan/projects/pin_wp>
    Options Indexes FollowSymLinks MultiViews +Includes
    AllowOverride None
    Order allow,deny
    allow from all
    AddOutputFilter INCLUDES .html
</Directory>

<Directory /home/alan/projects/pin_wp>
    Options Indexes FollowSymLinks MultiViews +Includes
    AllowOverride all
    Order allow,deny
    allow from all
    AddOutputFilter INCLUDES .html
</Directory>

现在一切正常。

艾伦

相关内容