very little hair left now.....

As I am a plunker at this please help me in terms I can get w/o bugging you to much…

I am having troubles with directory changes let me explain best I can.

Ok make it a short directry structure (unix), lets say it is as such (shortened)

maindir (all web files index etc here)
cgi-bin
images
includes
recipes <-- the problem one.

Ok under recipes I have a bunch of files for wine recipes. All in .php format, all images and everyting work fine, page loads fine all is cool. NOT. The problem I have is these files under recipes all have files linked in them FROM includes as in leftsidemenu.php, rightsidemenu.php, header.php etc…

In the leftsidemenu.php for example are links to the other pages under maindir. They all show up BUT the linkage is wrong. Example under maindir lets say the is a file aboutus.php that would be ex: http://www.oursite.com/aboutus.php cool. Now when I open up any file under recipe for ex: say redwine.php it comes up, all looks good except the linkage back to aboutus.php. It reads: http://www.oursite.com/recipe/aboutus.php. That aboutus.php shows now to be in the recipe dir instead of the maindir. I read/tried/read/tried and cannot find how I can correct it.

Please help in Stupid Person Terms… have not much hair left to pull… :’(

You need to edit links in the include files (leftsidemenu.php, rightsidemenu.php, header.php etc.) and change them to absolute. For example, you currently have link like this:

<a href="aboutus.php">About us</a>

the path in this link is relative to the directory where the web page is located.

You need to change link to this:

<a href="/aboutus.php">About us</a>

Or, alternatively, you can use meta tag to specify base url:

<base href="http://www.yoursite.com/">

Understand how to change links that is not a problem. But I cannot do that. If I did then the main site links would not work.

Again please help here.
ALL index.php, main site links like aboutus.php are all in the MAINDIR directory. The recipes are in another directory as are the includes as in below structure.

maindir
includes
recipes
add so on.

under recipes there are wine recipes that use the includes dir for leftside.php, rightside.php, header.php, footer.php and so on.

ALL works fine images footer etc except for leftside.php this is my directory link structure.

When you go to a recipe example http://www.ourtsite.com/index.php all is fine. Same structure http://www.oursite.com/recipe/something.php all is fine except for the links on the includes/leftside.php instead of going to the maindir as in http://www.ourtsite.com/index.php it goes to http://www.ourtsite.com/recipe/index.php. It thinks the recipe dir is now the main dir and I do not know how to get it back to the real maindir of http://www.ourtsite.com/

Yes I know I can input all with the path of http://www. etc etc in the side but then it would not work localhost. Got to be something I am not understanding/missing…

PLEASE BEGGING SOMEONE HERE for a answer…

Sponsor our Newsletter | Privacy Policy | Terms of Service