Welcome Guest, Not a member yet? Register   Sign In
URL redirect not working properly
#1

[eluser]Unknown[/eluser]
Hi,

Let's say I have a url: www.my-site.com/index.php/admin

I have a simple form which on submit should go to 'clients/add'.

Instead I get something like this: www.my-site.com/index.php/admin/www.my-site.com/index.php/clients/add

I am sure it's a simple amateur problem, but still a problem... Could somebody tell me:

1. why is this request handled this way.
2. how can i fix it.

Thanks! | Sebastian.
#2

[eluser]ejangi[/eluser]
in your /application/config/config.php file you need to fill in the:
Code:
$config['base_url'] = 'http://www.mysite.com/';
Option.

But, I think you're main problem is just that you're not putting the 'http://' at the start of your link. Either do a link as:
Code:
<a href="http://www.mysite.com/whatever">Whatever</a>
or use:
Code:
&lt;?php echo anchor('clients/add', 'Add a new client'); ?&gt;
And be sure to fill in the config item mentioned earlier.
#3

[eluser]Unknown[/eluser]
ucantblamem : Thanks, I had $config['base_url'] = 'www.mysite.com/' instead of $config['base_url'] = 'http://www.mysite.com/';

That did the trick,

C u around! | Sebastian.




Theme © iAndrew 2016 - Forum software by © MyBB