更改永久链接 wordpress 后出现 404 错误 [英] 404 error after changing permalinks wordpress

查看:42
本文介绍了更改永久链接 wordpress 后出现 404 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站是一个用 PHP 创建的 Wordpress-site.

My site is a Wordpress-site created with PHP.

我已将固定链接默认更改为 postname.它在 ChromeFirefox 中运行良好,但在 IE8 中不起作用.首页显示正确,但当我点击另一个页面的链接时,它显示 404 页面未找到错误.

I have made changes in permalink default to postname. It works fine in Chrome and Firefox but not in IE8. The front page displays correctly but when I click a link to another page, it shows a 404 page not found error.

我使用的是 Wordpress 版本 3+.

I'm using Wordpress version 3+.

.htaccess 文件是

.htaccess file is

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress

其中 WordPress 是文件夹名称.也在 apache rewrite_module 中启用

where WordPress is folder name. also in apache rewrite_module is enable

推荐答案

首先将 .htaccess 文件放入您的 /var/www/ 文件夹中并使其可写.其次,假设您的 wordpress 博客位于 /var/www/blog 文件夹中,然后转到 /etc/apache2/sites-available/并在默认文件中进行以下更改

First put a .htaccess file in your /var/www/ folder and make it writable. Second, suppose your wordpress blog is in /var/www/blog folder then go to /etc/apache2/sites-available/ and make following changes in default file

<Directory /var/www/>
    Options +ExecCGI 
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
</Directory>
<Directory /var/www/blog/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
</Directory>

现在重新启动 apache 以确保更改已生效.希望有帮助.

Now restart apache to make sure changes have taken effect. Hope it helps.

这篇关于更改永久链接 wordpress 后出现 404 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆