开发者

CodeIgniter htaccess subfolder problem

开发者 https://www.devze.com 2023-04-06 18:23 出处:网络
I want a second website in my domain inside the folder test www.mydomian.com/test Apache server running on linux.

I want a second website in my domain inside the folder test

www.mydomian.com/test

Apache server running on linux.

But when I load it in my navigator styles, images, helpers can't be found.

My htaccess 开发者_StackOverflowis like this:

RewriteEngine On

RewriteBase /test

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]

Thank you in advance

I have tried what you said, placing the htaccess file you gave me in the test folder and the other one in the root directory, it didn't work.

Other options?


Try adding a .htaccess file into your test folder instead.

I use this .htaccess content:

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

In the folder test I would place another .htaccess, with almost the same content:

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

精彩评论

暂无评论...
验证码 换一张
取 消