【问题标题】:Unable to run the URL without index.php没有 index.php 无法运行 URL
【发布时间】:2016-09-21 06:54:38
【问题描述】:

在我的 drupal 项目 www.example.com 我有 codeigniter 项目文件夹,如果没有 index.php >网址。 请提出任何解决方案

【问题讨论】:

  • 请分享您的 .htaccess
  • RewriteBase 上的 RewriteEngine /example/ RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /example/index.php/$1 [L]
  • htaccess 以上是 codeigniter 项目 www.example.com/example 文件夹

标签: .htaccess codeigniter drupal-7


【解决方案1】:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond $1 !^(index\.php|resources|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L,QSA] 

</IfModule> 

【讨论】:

    【解决方案2】:

    在 codeigniter 中,服务器的 URL 重写会有所不同。对于 linux,您应该使用 .htaccess 文件,对于 Windows,您应该使用 web.config 文件。您可以通过 google 获取这些文件。

    【讨论】:

      猜你喜欢
      • 2020-04-04
      • 1970-01-01
      • 1970-01-01
      • 2021-12-08
      • 1970-01-01
      • 2016-08-20
      • 1970-01-01
      • 1970-01-01
      • 2019-01-29
      相关资源
      最近更新 更多