Apache codeigniter中的htaccess问题

Apache codeigniter中的htaccess问题,apache,.htaccess,codeigniter,subdomain,codeigniter-2,Apache,.htaccess,Codeigniter,Subdomain,Codeigniter 2,我有两台服务器,分别是x.com和x.net x、 com有CodeIgniter 1.7,x.net有CodeIgniter 2.1 我正在使用htaccess来处理这两台服务器的子域 当我进入y.x.com时,它将转到x.com/y,y.x.net将转到x.net/y 但是x.net服务器上的htaccess不起作用 用于x.net的htaccess:: DirectoryIndex index.php RewriteEngine On RewriteCond %{REQUEST_FILE

我有两台服务器,分别是x.com和x.net
x、 com有CodeIgniter 1.7,x.net有CodeIgniter 2.1
我正在使用htaccess来处理这两台服务器的子域

当我进入y.x.com时,它将转到x.com/y,y.x.net将转到x.net/y
但是x.net服务器上的htaccess不起作用

用于x.net的htaccess::

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}
htaccess for x.com是相同的,只是站点名称不同

知道这是为什么吗?

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

您的.htaccess是我使用v1.7时的外观,即:

RewriteRule ^(.*)$ /index.php?$1 [L]
对于v2.0+,my.htaccess有几个附加指令。 因此,您是否可以尝试仅将这些添加到.htaccess for x.net

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

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

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

您的.htaccess是我使用v1.7时的外观,即:

RewriteRule ^(.*)$ /index.php?$1 [L]
对于v2.0+,my.htaccess有几个附加指令。 因此,您是否可以尝试仅将这些添加到.htaccess for x.net

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

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

您是否在DNS中设置了子域?是的,我添加了通配符*以重定向到web Root是否在x.net上启用了htaccess?是的,htaccess已启用您是否在DNS中设置了子域?是的,我添加了通配符*以重定向到web Root是否在x.net上启用了htaccess?是的,htaccess已启用