【问题标题】:Drupal URL Rewriting conflictDrupal URL 重写冲突
【发布时间】:2011-10-08 15:05:43
【问题描述】:

我在站点的根目录中安装了 Drupal 7。 .htaccess 文件自安装后未修改。

不过,我还在子目录中设置了 CodeIgniter。我在 CI 目录中创建了一个 .htaccess 文件,其中包含从 url 中删除 index.php 的建议说明。

例如。 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 重写规则?

非常感谢

编辑:解决方案是,在 Drupal 的 .htaccess 中的 RewriteEngine on 规则之后,我立即插入

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

希望这可以帮助任何有类似设置的人。

【问题讨论】:

  • 我刚刚解决了!在 Drupal 的 .htaccess 中的 RewriteEngine on 规则之后,我立即插入 RewriteCond $1 !^(index\.php|images|robots\.txt) 然后 RewriteRule ^ci_site/(.*)$ ci_site/index.php/$1 [L] 没有任何问题。对于任何有类似设置的人。
  • 将您的解决方案放入答案中,一旦分配的时间过去,将其标记为已接受:)
  • 正如拉克斯曼所说,您应该回答并标记您的回答已接受,否则它会一直出现在未回答的问题列表中:)

标签: regex drupal .htaccess codeigniter mod-rewrite


【解决方案1】:

复制问题。我来到这里想帮助别人,在阅读了问题后,我看到了里面的解决方案......

解决方案是,在 Drupal 的 .htaccess 中的 RewriteEngine on 规则之后,立即插入

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-12-11
    • 1970-01-01
    • 2012-10-09
    • 2015-04-15
    • 2019-11-24
    • 1970-01-01
    • 2011-11-21
    • 1970-01-01
    相关资源
    最近更新 更多