【发布时间】:2015-08-05 06:10:25
【问题描述】:
所以这个问题的标题有点难以想出。这是交易,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/function
目前我有这个:
顶层.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 或无效。任何帮助将不胜感激。
【问题讨论】:
-
请确保在您的 /etc/httpd/conf/httpd.conf 中或请搜索您的 httpd.conf 文件在哪里并将 AllowOverride None 更改为 AllowOverride All
-
我做了更改,谢谢。
-
抱歉,我做了更改,但实际上并没有改变任何东西。我只是假设这是过程的一部分。
-
RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] 现在试试这个
-
复制上面的整个代码到你的.htaccess
标签: wordpress .htaccess codeigniter codeigniter-3