【问题标题】:CodeIgniter htaccess subfolder problemCodeIgniter htaccess 子文件夹问题
【发布时间】:2011-11-23 13:23:32
【问题描述】:

我想要在我的域中文件夹 test 中的第二个网站

www.mydomian.com/test

在 linux 上运行的 Apache 服务器。

但是当我在导航器样式中加载它时,无法找到图像、助手。

我的htaccess是这样的:

重写引擎开启

RewriteBase /测试

RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|robots\.txt)


RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /test/index.php?/$1 [L]


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

提前谢谢你

你说的我试过了,把你给我的htaccess文件放在test文件夹里,另一个放在根目录下,还是不行。

其他选项?

【问题讨论】:

  • 所以您在 www.domain.com 上运行 CodeIgniter 网站,并且想要在 www.domain.com/test 中再添加一个?

标签: apache .htaccess codeigniter subdirectory


【解决方案1】:

尝试将 .htaccess 文件添加到您的测试文件夹中。

我使用这个 .htaccess 内容:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

test 文件夹中,我会放置另一个 .htaccess,内容几乎相同:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /test/index.php?/$1 [L]

【讨论】:

    猜你喜欢
    • 2015-03-25
    • 2021-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-13
    • 2020-08-28
    • 1970-01-01
    相关资源
    最近更新 更多