0

Okey guys i have my project deployed to a subdomain folder on my server and when I try to access that subdomain -> new.mysite.com code igniter loads the 404 not found page.

It works perfectly on localhost and on a server without subdomain for example mysite.com.

Any ideas? I tried to change the base_url to new.mysite.com and it doesnt work.

Is there a way to see what url it is realy trying to load I don't know. I'm desperate i guess i have to touch the routes but what to write there?

5
  • Why don't you change the base_url to something.new.mysite.com? Commented Oct 30, 2011 at 12:35
  • But it doesnt work for the main page which is a subdomain. The main page is new.mysite.com. And it does not work for it. Commented Oct 30, 2011 at 12:38
  • Put your full baseurl configuration settings into the question please. Commented Oct 30, 2011 at 12:40
  • Well it's set to none => base_url= ''; base_url ='new.mysite.com' neither of them work. Commented Oct 30, 2011 at 12:42
  • That's not even valid PHP code, I would not wonder that it doesn't work. Take a look as well as similar tagged questions: stackoverflow.com/questions/tagged/codeigniter+subdomain Commented Oct 30, 2011 at 12:44

1 Answer 1

1

This probably hasn't got to do with your base_url setting. If your index page doesn't get loaded, something else is probably wrong.

Are you getting CodeIgniter's 404 message, or Apache's?

In case you're getting CodeIgniter's 404 message (even for your default index page), chances are CodeIgniter isn't able to parse the relevant URL section correctly. In that case: please check (or provide us with) your .htaccess file (in case you're using mod_rewrite).

On a personal note: I've experienced such problem before too. After much fiddling and cursing, I eventually decided to just dive into CodeIgniter's system files (I believe it was system/core/CodeIgniter.php) and to alter the piece of code that reads the relevant piece of the url.

Sign up to request clarification or add additional context in comments.

5 Comments

Yes it is code igniter's 404 and no I'm not using .htaccess because the server does not have mod_rerwite loaded... I guess i will do the same like you, but i hope for a better solution without .htaccess :(
Well i just noticed that i can access my views by typing the url new.mysite.com/applicaiton/views/view.php and they get displayed properly so what is the problem then !??!?!
Without htaccess, you can access those files (which is why most files created by CodeIgniter start with a check to see if it's accessed like that, and display an error if that's the case).
Before you go and edit the system file, please provide your routing configuration. Maybe there's something wrong there.
I just realised that the linux server was case sensitive and I had my controler named Home.php but codeigniter lowers it instead of "Home" it passes "home" it then the url is not found... Thank you anyway :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.