【问题标题】:wordpress page can't be found, wordpress is installed in the sub directory找不到wordpress页面,wordpress安装在子目录下
【发布时间】:2018-10-31 12:18:52
【问题描述】:

我的 Wordpress 网址:

mydomain.com/blog

我的网站网址:

 mydomain.com

index.php 和 .htaccess 文件在 blog 文件夹中。

博客/index.php

<?php
define('WP_USE_THEMES', true);
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

博客/htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} ^m=1$
RewriteRule ^(.*)$ /$1? [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

博客/wp-config.php

if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');

当我访问我的页面 mydomain.com/blog/index.php 时,它显示页面找不到错误。如何解决这个问题?

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    你的htaccess代码应该是

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-14
      • 2018-02-05
      • 2021-10-14
      • 2013-04-26
      • 2019-10-22
      • 2012-10-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多