Drupal URL 重写冲突 [英] Drupal URL Rewriting conflict
问题描述
我在网站的根目录中安装了 Drupal 7..htaccess 文件自安装以来未被修改.
I have Drupal 7 installed in the root directory of my site. The .htaccess file hasn't been modified since installation.
但是,我还在子目录中设置了 CodeIgniter.我在 CI 目录中创建了一个 .htaccess 文件,其中包含从 url 中删除 index.php 的建议说明.
However, I also have CodeIgniter set up in a subdirectory. I created a .htaccess file in the CI directory with the suggested instructions to remove index.php from the url.
例如.mysite.com/subsite/index.php/blog --> mysite.com/subsite/blog
eg. mysite.com/subsite/index.php/blog --> mysite.com/subsite/blog
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
不幸的是不起作用.我认为 Drupal 的 .htaccess 规则是有冲突的.Drupal的.htaccess应该写什么规则来启用CodeIgniter重写规则?
Unfortunately doesn't work. I assume Drupal's .htaccess rules are conflicting. What rules should I write Drupal's .htaccess to enable the CodeIgniter rewriting rules?
非常感谢
编辑:解决方案是,在 Drupal 的 .htaccess 中的 RewriteEngine on 规则之后,我立即插入
EDIT: Solution is, immediately after the RewriteEngine on rule in Drupal's .htaccess, I inserted
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^ci_site/(.*)$ ci_site/index.php/$1 [L]
希望这可以帮助任何有类似设置的人.
Hopefully this helps anyone who has a similar setup.
推荐答案
从问题中复制.我来到这里是想帮助某人,在阅读问题后,我看到了里面的解决方案......
Copy from the question. I landed here wanting to help somebody and, after reading the question, I saw the solution inside...
解决方案是,在 Drupal 的 .htaccess 中的 RewriteEngine on 规则之后,立即插入
The solution is, immediately after the RewriteEngine on rule in Drupal's .htaccess, inserting
RewriteCond $1 !^(index.php|images|robots.txt)
RewriteRule ^ci_site/(.*)$ ci_site/index.php/$1 [L]
这篇关于Drupal URL 重写冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!