Make sure subdomains are enabled on your site. When you log in to test.yoursite.com, it should send you to the welcome page of your site. If instead it gives a DNS lookup error, then this means that subdomains are not enabled on your site.
To enable subdomains on your site, add the *.yoursite.com entry in the DNS zone entry.
Paste the following code into your .htaccess file and replace yoursite accordingly.
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #codeigniter specific rule RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L] #codeigniter specific rule RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php?/$1 [L] #this rule removes www from the URL if its used RewriteCond %{HTTP_HOST} ^www. RewriteRule ^(.*)$ http:
Add additional rules, if necessary, to handle the system or auth subdomains. I know what I did for my site to get a pretty URI.
Important Note:
I found that by default, subdomain URIs work very well with codeigniter without any of the above rules. You can access all your sites using test.yoursite.com/# URI instead of www.yoursite.com/# . But URIs are not very good, and more than one way to access the URI would be available.
So, if you use the rules above, this will give you nice URIs and, more importantly, give you unique URIs . Therefore, if you use the above rules, you will receive only one URI for the registration page, and this is http://yoursite.com/signup .
Harikrishnan
source share