繁体   English   中英

如何从根目录上的Wordpress的子目录中的CodeIgniter3安装中删除index.php?

[英]How to remove index.php from CodeIgniter3 install in subdirectory with Wordpress on root?

因此,提出这个问题的标题有些困难。 达成协议后,CI3的安装就像这样:www.mydomain.com.au/apps/TGPS其中TGPS是CI应用程序。 此外,在Web文件夹的根目录上有一个Wordpress安装。 我的问题是,我需要从以下网址压缩URL的.htaccess设置是什么:www.domain.com/apps/TGPS/index.php/controller/function到以下网址:www.domain.com/apps/TGPS/controller /功能

目前我有这个:

在此处输入图片说明

顶级.htacess是这样的:

# BEGIN WordPress
RewriteRule ^/apps($|/) - [L] 
# END WordPress

TGPS中的.htaccess是这样的:

<IfModule mod_rewrite.c>
    RewriteEngine On

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    #This last condition enables access to the images and css folders, and the robots.txt file
    RewriteCond $1 !^(index\.php|public|images|robots\.txt|css)
    RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>

应用中的.htaccess是标准的。

似乎我尝试执行的所有操作都破坏了Wordpress,CodeIgniter或无效。 任何帮助,将不胜感激。

乍一看,您缺少重写基础:

RewriteBase /apps/TGPS/

尝试下面的代码

    RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php
RewriteRule ^index\.php$ / [L,R=301]

然后将www改为非www:

RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM