Welcome Guest, Not a member yet? Register   Sign In
Issues using redirect
#1

[eluser]rossmurphy[/eluser]
I have been using redirect with no problem and all of a sudden it has been giving me issues.

I use this

Code:
redirect('helpdesk/contactus');

in order to redirect users to the helpdesk/contact us if they cannot login. But for some reason, it is taking me to my base_url, as if it can't find the page so its redirecting to my base_url? i haven't set any 404 redirects.

But then if i go like this..

Code:
redirect(base_url().'/helpdesk/contactus');

I works!!! WTF!! I shouldnt have to use base_url here right?

AND THEN.. i also noticed... my forms were using and working with relatvie urls...then at the same time my forms would only work with..

Code:
base_url.'/members/login'

instead of just

Code:
members/login'


Does anyone know what might be going on here? have i changed something? does this have anything to do with the site_url?

thanks
#2

[eluser]renownedmedia[/eluser]
Try doing this:

Code:
?>
<head>
  <base href="<?=base_url()?>" />
</head>
<?php

What that does is make everything relative to the root of your application. When you are at app.com/controller, and you link to "controller2", you are linking to app.com/controller2. But, when you are at app.com/controller/item and you link to "controller2", you are actually linking to app.com/controller/controller2 (the browser treats these like subdirectories and appends the link to the root of the subdirectory). By using your base href that issue goes away.

Not sure if this is the issue you're having but it sounds like it.
#3

[eluser]Raymond Steigerwalt[/eluser]
Check your config file. Make sure you have an ending slash in your $config['base_url']

Seems to me like it is trying to redirect to http://yoursite.comhelpdesk/contactus instead of http://yoursite.com/helpdesk/contactus

Just a thought.




Theme © iAndrew 2016 - Forum software by © MyBB