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

  • 写回答

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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 脱敏项目合作,ner需求合作
  • ¥15 脱敏项目合作,ner需求合作
  • ¥30 Matlab打开默认名称带有/的光谱数据
  • ¥50 easyExcel模板 动态单元格合并列
  • ¥15 res.rows如何取值使用
  • ¥15 在odoo17开发环境中,怎么实现库存管理系统,或独立模块设计与AGV小车对接?开发方面应如何设计和开发?请详细解释MES或WMS在与AGV小车对接时需完成的设计和开发
  • ¥15 CSP算法实现EEG特征提取,哪一步错了?
  • ¥15 游戏盾如何溯源服务器真实ip?需要30个字。后面的字是凑数的
  • ¥15 vue3前端取消收藏的不会引用collectId
  • ¥15 delphi7 HMAC_SHA256方式加密