Drupal URL Rewriting conflict

♀尐吖头ヾ 提交于 2019-12-12 13:40:27

问题


I have Drupal 7 installed in the root directory of my site. The .htaccess file hasn't been modified since installation.

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.

eg. mysite.com/subsite/index.php/blog --> mysite.com/subsite/blog

RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

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?

Many thanks

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.


回答1:


Copy from the question. I landed here wanting to help somebody and, after reading the question, I saw the solution inside...

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]


来源:https://stackoverflow.com/questions/6749399/drupal-url-rewriting-conflict

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!