【问题标题】:Codeigniter Subfolder [closed]Codeigniter 子文件夹 [关闭]
【发布时间】:2012-12-25 07:54:56
【问题描述】:

我的网站中有一个 CodeIgniter,比如 abc.com 。我已将全部内容复制到同一站点的子文件夹中,例如 abc.com/test。但我无法使用 abc.com/test 访问该站点。 任何人都可以在这方面帮助我

谢谢

【问题讨论】:

  • 最好复制 codeigniter 文件夹,然后将其移动到子文件夹中。我想它会工作
  • 顺便说一句,它对我有用!我尝试过这个。你能显示你.htacess的内容吗?
  • 这是根文件夹中的 .htaccess 文件 ** RewriteBase 上的 RewriteEngine / RewriteCond 上的 RewriteEngine $1 !^(index\.php|lib|robots\.txt) RewriteRule ^(.*)$ 索引。 php/$1 [L] **
  • RewriteEngine on RewriteBase /test/ RewriteEngine on RewriteCond $1 !^(index\.php|lib|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] 是我在测试文件夹中使用的 .htaccess 文件
  • 查看@Gerben 提供的需要在根.htaccess 上的答案,否则所有请求都会被根上的.htaccess 匹配。另外,考虑使用RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d,我认为这会更好

标签: .htaccess codeigniter subdirectory


【解决方案1】:

根 htaccess

RewriteEngine on 
RewriteBase / 
RewriteCond $1 !^(index\.php|lib|robots\.txt|test) 
RewriteRule ^(.*)$ index.php/$1 [L]

【讨论】:

【解决方案2】:

在一切之前,您应该检查您是否在配置文件中更改了 codeginiter 基本 url。 您的新基本网址类似于 http://abc.com/test/ 并记住在测试后添加斜杠/

【讨论】:

    猜你喜欢
    • 2017-02-09
    • 2010-09-13
    • 2015-03-25
    • 2013-01-27
    • 2011-11-23
    • 1970-01-01
    • 2013-02-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多