Jump to content

Header('location: ') Question


slj90

Recommended Posts

So I have a header('Location: ') in my script and it works fine if I enter something like

 

header('Location: profile.php ')

 

It will go to http://www.example.com/profile.php

 

But I am trying to make it go to the homepage of the site which is just http://www.example.com. I don't want it to show index.php or default.php.

 

So my question is what do I need to put in header('Location: ') for it to direct back to the homepage http://www.example.com

 

Thanks

Link to comment
Share on other sites

I was going to say, do you have the write file path. I always keep my pages in a lower folder than my index. So mine would look like:

 

header('Location:../index.php');

 

This will be the third time I have mentioned this, but the Location header requires a url.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.