path problems php, trying to enable easier file management, paths are linking to new folder file is located in.

I currently have most of my files located in my root folder of my website.  I want to breakdown the site for easier management and in doing so I am running into path issues.  For instance, if you look at the following link  http://www.milehighlistings.com/pricing/  all the links(navigation bar, sidebar etc.) are referring to the pricing folder.  How can I fix this without having to modify each link or add these files to my pricing folder.  
mnoel76Asked:
Who is Participating?
 
RedKelvinCommented:
Hi mnoel76

The page you have given is located in the pricing folder.

All of your links have no path prefix, so they are all looking  in the current folder, which is "pricing"

If you want all of these files to look in another location, you have no choice but to code the new paths in.

RedK
0
 
mnoel76Author Commented:
RedK

If some of these files are located in my root folder and within those files there are links to other dynamically generated files in the root folder how do I code to handle this.  For instance, in the sidebar I have a php file called most_popular which links to a file in the root folder..http://www.milehighlistings.com/detail.php?id=12(dynamic) is there anyway I can code to handle queries from both the root folder and the pricing folder or do I need to copy the most_popular file to the pricing folder to handle this?  I hope I have explained this clearly for you.

thanks
0
 
RedKelvinCommented:
Ok, i think I know what you are after, you are creating the paths from 2 different folders, however all of your paths are relative paths. ie. the files have no path in front of them, so they are looked for in the same folder as the parent.

One way around this is to specify the full path to the files in your links.

eg. instead of MyFile.htm use
http://www.milehighlistings.com/myFolder/MyFile.htm

Hope that helps
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LeeKowalkowskiCommented:
You could put a BASE element in your HTML HEAD.  It's recommended to be before any stylesheet or script includes.

Personally, I would have had all my local links start with a slash (/) from the start.

--
Lee
0
 
RedKelvinCommented:
Hi there,
How are you going with your problem, any updates? Have any of the suggestions helped?

RedK
0
 
mnoel76Author Commented:
RedK thanks for checking in.  Just got back from Honeymoon.  I have decided to abandon breaking up the site into folders for the meantime.   Thanks everybody for your input!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.