views:

30

answers:

1

Dear all,

I have an issue with url direction here. I have used mod_rewrite in apache to rewrite the url from domain.com/page.php to domain.com/path/page.php.

I have some link in the webpage for example href="newpage.php" will automatically go to domain.com/path/newpage.php instead of domain.com/newpage.php. May I know is there any php method to set all the default url in the php file itself to avoid this path issue? without using any variable like href="<?php echo $_SERVER['domain']; ?>newpage.php"

thank you.

+1  A: 

If you know how many folders deep the file is you could just backtrack by doing ../newpage.php. So if you're at domain.com/folder/currentpage.php you could do ../newpage.php. To get to domain.com/newpage.php.

blcArmadillo