找不到Wordpress固定链接404 [英] Wordpress permalinks 404 not found

查看:144
本文介绍了找不到Wordpress固定链接404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的永久链接结构修改为/%postname%/以在wordpress网站服务器上使用Buddypress.

i want to modify my permalink structure to a /%postname%/ to use Buddypress on a wordpress website server.

经过一番尝试,我遇到了一些麻烦,即使在其他论坛中进行搜索,我也不知道如何解决.

After some trial, i experiencing some trouble and even with my search in different forum, i don't know how to solve it.

我的.htaccess权限适用于试用版666,因此wordpress不得不修改此文件,但不会(在我的服务器安装中最后一个文件被修改).在数据库中,永久链接结构成功传递到%postname%.

My .htaccess permission is for the trial 666 so wordpress have to modify this file, but won't (last file modify at my server installation). In the database, the permalinks structure succesfully passed to %postname%.

现在,我要访问的所有页面都有404错误.

Now, i have a 404 error in all pages i want to access.

.htaccess文件:

.htaccess file :

# 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

我正在运行Apache,因此为了强制进行vars选择,我在wp-include/vars.php中对此进行了修改:

I running Apache, so to force the vars selection, i modified to this in the wp-include/vars.php :

//$is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false);
$is_apache = 1;

我现在要做什么?

我已经重新安装了它,然后尝试执行所有这些操作,并且存在相同的问题... Apache是​​文件的所有者,所以我真的不理解...

EDIT : I've reinstalled it, retry to do all of this, and same problem... Apache is owner of the file so i really don't understand...

推荐答案

好的,我已经解决了这个问题.

Okay, i've solved the question.

问题,我在问题说明中未指定,是我使用Virtualhost(我在该服务器上也有一个监视网站,所以我想分离所有任务,日志等...),在那里是virtualhost和此指令的问题:

The problem, and i haven't specified it in my problem explanation, is i use Virtualhost (i have too a monitoring website in this server so i wanted to separate all the task, logs etc...), and there is a problem with virtualhost and this instruction :

RewriteBase /

实际上,这可以在正常的Apache环境中工作,而不能在virtualhost中工作.

In fact, this work in normal apache environnment but not in virtualhost.

所以我要做的是将.htaccess内容移动到vhost conf.d文件中:

So what i had to do is to move my .htaccess content on the vhost conf.d file :

<VirtualHost *:80>
    ServerAdmin nfrbezar@vdbassocies.fr
    ServerName intranet.vdb.local
    ServerAlias intranet
    
    DocumentRoot /var/www/vhosts/intranet/html

    ErrorLog /var/www/vhosts/intranet/logs/error.log

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

    CustomLog /var/www/vhosts/intranet/logs/access.log combined

    <Directory "/">
       RewriteEngine On
       AllowOverride None
       Allow from 10.1.1.0/8
       
       <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteBase /
            RewriteRule ^index\.php$ - [L]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule . /index.php [L]
        </IfModule>

    </Directory>

</VirtualHost>

通过这种方式,它现在可以工作了!

And by this way, it now work !

很抱歉没有告诉您这是虚拟主机,即使我认为这是一个Apache问题,我也不认为这对于解决问题很重要.

Sorry for not telling you that it was a virtualhost, i doesn't think it was important for the problem resolution, even if i supposed it was an apache problem.

这篇关于找不到Wordpress固定链接404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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