Welcome Guest, Not a member yet? Register   Sign In
post is going to wrong controller url
#1

[eluser]cpscdave[/eluser]
Hi everyone,
I recently changed our local enviroment to run off of a virtual host instead of off of localhost
Everything seems to be working except 1 annoying thing.

Whenever I do a relative path post, it goes to the wrong url.

EG:
I have a post at itinerary/addentry posting to itinerary/addentry.
But whats happening is the server is attempting to post to itinerary/itinerary/addentry.

Any ideas on what exactly is causing this or where to start looking??

**EDIT** I found a work around that will work I suppose.
I've set in the config base_url to http://my_virtual_server it seems to be workign now. But I'd still be interested to know what the proper way to fix this would be.
#2

[eluser]WanWizard[/eluser]
The base_url in your config should always match your site's base_url, so that's not a work-around, that's by design.

And relative links are always a bad idea, because more often than not, you haven't got a clue to what they are relative to. Especially when someone else wrote the code.
When you want to generate links, use
Code:
site_url('itinerary/addentry');
or use base_url();




Theme © iAndrew 2016 - Forum software by © MyBB