dongxia2068
2016-03-31 09:56
浏览 57
已采纳

Wordpress永久链接404未找到

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.

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%.

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

.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

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;

What i have to do now ?

#

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...

图片转代码服务由CSDN问答提供 功能建议

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

经过一些试验,我遇到了一些麻烦,即使我在不​​同的论坛搜索,我也不知道如何解决它。

我的。 htaccess权限是针对试用版666所以wordpress必须修改此文件,但不会(在我的服务器安装时修改最后一个文件)。 在数据库中,永久链接结构成功传递到%postname%。

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

.htaccess文件:

  #BEGIN WordPress 
&lt; IfModule mod_rewrite.c&gt; 
RewriteEngine On 
RewriteBase / 
RewriteRule ^ index \ .php $  -  [L] 
RewriteCond  %{REQUEST_FILENAME}!-f 
RewriteCond%{REQUEST_FILENAME}!-d 
RewriteRule。  /index.php [L] 
&lt; / IfModule&gt; 
 
 #END WordPress 
   
 
 

我运行Apache,所以强制选择vars,我修改了 在wp-include / vars.php:

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

我需要什么 现在做什么?

编辑:我已重新安装它,重试所有这一切,同样的问题...... Apache是​​该文件的所有者所以我真的不喜欢 不明白......

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

5条回答 默认 最新

  • doumao1047 2016-03-31 13:16
    已采纳

    Okay, i've solved the question.

    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 /

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

    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 !

    enter image description here

    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.

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • dongyanju1094 2016-03-31 11:31

    If you are able to access wp-admin panel then please try to update permalink structure to "Plain" and then check you are still getting 404 page error or not.

    评论
    解决 无用
    打赏 举报
  • dpkt17803 2016-03-31 11:42

    According to the Wordpress permission of.htaccess should be 604. Apply this permission and check it.

    600 -rw-------  /home/user/wp-config.php
    604 -rw----r--  /home/user/cgi-bin/.htaccess
    600 -rw-------  /home/user/cgi-bin/php.ini
    711 -rwx--x--x  /home/user/cgi-bin/php.cgi
    100 ---x------  /home/user/cgi-bin/php5.cgi
    
    评论
    解决 无用
    打赏 举报
  • douduan5753 2016-05-20 13:07

    even I had the same issue when I deployed my wordpress site in aws ubuntu machine with apache server we have to add this lines in 000-default.conf if you have deployed your wordpress site in /var/www/html

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

    then we have to restart apache server sudo service apache2 restart

    评论
    解决 无用
    打赏 举报
  • doumi1852 2018-07-09 06:46

    Also make sure that .htaccess with the necessary permissions is in /var/www/html even if the wordpress installation is on a different folder

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题