1

I've 2 servers say x.com and x.net
x.com has CodeIgniter 1.7 and x.net has CodeIgniter 2.1
I'm using a htaccess to handle subdomain for the two servers

when I enter y.x.com it will go to x.com/y and y.x.net to x.net/y
But htaccess on the x.net server isn't working

the htaccess for x.net::

DirectoryIndex index.php
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^index\.php
RewriteCond %{HTTP_HOST} ^(.*)\.x\.net
RewriteCond %{HTTP_HOST} !^www\.x\.net
RewriteCond %{HTTP_HOST} !^x\.net
RewriteRule ^(.*)$ %1/%{REQUEST_URI}

the htaccess for x.com is the same just the site name is different
any idea, why is this happening?

4

1 回答 1

1

我知道 CI 应用程序文件夹是从系统文件夹中带出来的,比较 v2.0 和 v1.7

你的 .htaccess 是我使用 v1.7 时的样子,即:

RewriteRule ^(.*)$ /index.php?$1 [L]

对于 v2.0+,我的 .htaccess 有几个附加指令。因此,您可以尝试将这些添加到您的 .htaccess for x.net

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

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
于 2012-05-04T01:58:18.680 回答