Mazhar Ahmed
Mazhar Ahmed

Reputation: 1543

htaccess issue in codeigniter

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?

Upvotes: 1

Views: 166

Answers (1)

tim peterson
tim peterson

Reputation: 24315

I know the CI application folder was brought out of the system folder comparing v2.0 vs. v1.7

your .htaccess is how mine looked when I was using v1.7, that is:

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

For v2.0+, my .htaccess has a couple additional directives. Therefore, can you try adding these to your .htaccess for x.net ONLY?

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

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

Upvotes: 1

Related Questions