header ("Location:") Redirect from the root directory

0

Hello! I'm a beginner in php, and I'm having trouble using the header (location) function.
Whenever I redirect a page, the path is from the current page directory!
Ex: Home / Forum / Images / If I have a page inside the / Forum / folder and I use header("Location: Localhost/Home/Pagina.php") to access a page that is in the < the link is "Localhost / Forum / Home / Pagina.php", and logically it does not find, is there any way I can always set the directory search from the root directory of the site? so that searches are always made from / Home / and not from the page that has the Header () function? and the same doubt applies to form action, when I create php forms!

Thanks dede já!

.htaccess

<files phpsysinfo.ini>
  order deny,allow
  deny from all
</files>
    
asked by anonymous 13.02.2015 / 02:23

1 answer

2

I do not understand exactly what you're doing, but do so:

header("Location: /Home/Pagina.php");
    
13.02.2015 / 02:30