URL issues going from a Local to Server environment |
[eluser]Timothy_[/eluser]
Hello, I have been developing an application using Codeigniter 1.7.1 using LAMPP on my ubuntu machine. I have been using a .htaccess file (see below) to remove index.php from the URL. Moving the application to a server environment however is causing quite a few headaches. Codeigniter 404's whenever i visit a controller without the index.php (for e.g. http://www.subdomain.domain.com/codeigniter/controller) Things start working when i place the index.php in (for e.g. http://subdomain.domain.com/codeigniter/...controller) However this is not good because I don't want index.php to be seen. I have tried each of the available URI protocols Code: $config['uri_protocol'] = "AUTO"; My .htaccess looks like this: Code: <IfModule mod_rewrite.c> My Code igniter logs look like this: Code: DEBUG - 2009-10-05 17:56:09 --> Config Class Initialized I assume its a .htaccess issue. If someone has any suggestions I would really appreciate some help. Thanks Tim
[eluser]n0xie[/eluser]
Are you sure that mod_rewrite is loaded on the production server? Also the question mark after your index.php shouldn't be necessary. Try to remove it and see if that helps.
[eluser]Timothy_[/eluser]
Hello nOxie, Thanks for the reply ![]() mod_rewrite is definetely loaded. I am using it on other live sites. I tried http://subdomain.domain.com/codeigniter/...controller and that does work. So where does this leave me now? Could the subdomain be causing problems? How am I able to get rid of the index.php ? Thanks again, Tim
[eluser]n0xie[/eluser]
Is your basepath correctly defined? Else play around with the .htaccess. Remove the question mark as I said. Then change the uri_protocol around (PATH_INFO is preferred). It's a bit hit or miss with .htaccess depending on how apache is setup...
[eluser]Timothy_[/eluser]
Hello n0xie, Yes basepath is fine and i tried changing the uri_protocols but none worked. I have solved this problem by giving it its own subdomain. Before i had http://subdomain.domain.com/codeigniterroot/controller Now i have http://subdomain.domain.com/controller and it works great. Appreciate all your help ![]() Tim |
Welcome Guest, Not a member yet? Register Sign In |