1

所以这个问题的标题有点难以想出。这是交易,CI3 安装是这样的: www.mydomain.com.au/apps/TGPS 其中 TGPS 是 CI 应用程序。此外,在 web 文件夹的根目录上还有一个 Wordpress 安装程序。我的问题是,我需要从 www.domain.com/apps/TGPS/index.php/controller/function 压缩 URL 的 .htaccess 设置是什么: 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 或没有效果。任何帮助,将不胜感激。

4

2 回答 2

0

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

RewriteBase /apps/TGPS/
于 2015-05-23T07:06:34.433 回答
0

试试下面的代码

    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]
于 2015-05-23T07:08:45.297 回答