CodeIgniter Forums
Installing CodeIgniter in Subdomain Problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Installing CodeIgniter in Subdomain Problem (/showthread.php?tid=24513)



Installing CodeIgniter in Subdomain Problem - El Forum - 11-11-2009

[eluser]robert.dejesica[/eluser]
Hi Guys

I have this little problem

I installed my codeigniter application into subdomain

http://mysubdomain.domain.com/ If im going to visit this site the routes work's fine. it go to default routes.

However if im going to visit something like this

http://mysubdomain.domain.com/controller/ it gives me an error Page Not Found

This is my .htaccess
Code:
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Any reply is appreciated.


Installing CodeIgniter in Subdomain Problem - El Forum - 11-12-2009

[eluser]slhawkins[/eluser]
To be honest I wouldn't have any idea what's wrong and what makes mod_rewrite do what.. But I just started working with CI the other day and have been testing it on a subdomain myself. Below is my .htaccess... To be honest though, the biggest problem I had was to make sure the module was loaded, so I would double check that your mod_rewrite is loaded. Probably the simplest way to do that would be a simple phpinfo() call. Scroll down to the 'apache2handler' table and it should have a row labeled 'Loaded Modules'. mod_rewrite should be in there..

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>



Installing CodeIgniter in Subdomain Problem - El Forum - 11-12-2009

[eluser]robert.dejesica[/eluser]
hi slhawkins for thanks the reply. I replaced my .htaccess to your provided code. but I still get the same error. I forgot to mention also that subdomain is hosted in separate box from the domain. I'm not sure if it's an issue.


Installing CodeIgniter in Subdomain Problem - El Forum - 11-12-2009

[eluser]slhawkins[/eluser]
Did you verify if mod_rewrite is loaded? I know it sounds stupid.. but it had me stumped for a little bit.


Installing CodeIgniter in Subdomain Problem - El Forum - 11-12-2009

[eluser]robert.dejesica[/eluser]
yup it's loaded. the weird thing here is I have also site built in CI hosted in that server and its work fine.


Installing CodeIgniter in Subdomain Problem - El Forum - 11-12-2009

[eluser]slhawkins[/eluser]
Only thing I can think of is the config variables..

Code:
$config['index_page'] = "";

Apologies, just started working with CI yesterday Sad


Installing CodeIgniter in Subdomain Problem - El Forum - 11-12-2009

[eluser]robert.dejesica[/eluser]
no worries Smile I also did that