【问题标题】:Install Wordpress in subdirectory as addon domain and remove install folder in url在子目录中安装 Wordpress 作为插件域并删除 url 中的安装文件夹
【发布时间】:2019-07-04 00:47:09
【问题描述】:

我已经安装了一个插件域并在我为新站点安装 wordpress 的 public_html 文件夹中创建了一个子目录。一切正常,除了我无法从 url 中删除子文件夹。我认为在 addondomain 中更改 htaccess 文件是问题所在。

wordpress地址网址http://addondomain.com/addondomain 网址http://addondomain.com

在我更改的 addondomain 文件夹中的 index.php 中

require( dirname( __FILE__ ) . '/wp-blog-header.php' );

require( dirname( __FILE__ ) . '/addondomain/wp-blog-header.php' );

插件目录中我的htaccess文件

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

public_html 主目录中的 htaccess 文件(包含另一个域的文件)

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

我只想从 url 中删除 wordpress 安装文件夹,但我有一个域和子域以及两个 wp 安装。

【问题讨论】:

    标签: wordpress .htaccess url-rewriting addon-domain


    【解决方案1】:

    从插件目录中.htaccess文件的最后一条规则中删除/addondomain(RewriteBase保持原样)。

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

    【讨论】:

      【解决方案2】:

      问题实际上出在插件域的根文件夹中,它被设置为根目录,而不是子目录。

      【讨论】:

        猜你喜欢
        • 2021-09-10
        • 2017-12-04
        • 1970-01-01
        • 1970-01-01
        • 2011-08-10
        • 1970-01-01
        • 2017-06-20
        • 1970-01-01
        • 2017-07-07
        相关资源
        最近更新 更多