|
|
#1 |
|
New Member
![]() Join Date: Jul 2009
Posts: 4
|
what is the best practice to link to a page within the site from 2 different levels of directory
ex. site.com/path/to/file/1.html and site.com/path/to/listing.html both of those need to have a link to "site.com/index.html" I am using an navbar which is being included via php so i have to have the same link for the whole site. is my only option to use the full url for the page? http://www.site.com/index.hml ? |
|
|
|
|
|
#2 |
|
Gold Member
![]() Join Date: Nov 2009
Location: New York
Posts: 370
|
Just use the full URL, I think it would be better for SEO anyhow.
But to solve your problem I've had to do this before. What I ended up doing was using a PHP variable that stores the current page ($_SESSION['page'] = 'home' BEFORE the include) and you can echo the links you want based on that page in your header PHP. |
|
|
|
|
|
#3 |
|
Bronze Member
![]() Join Date: Jun 2009
Posts: 31
|
you may have some issues using the full path as someservers wont allow it. that said its the easiest way of doing what you want if yourserver supports it
__________________
Yorkshire website design solutions by Web Design Sheffield. Hosting Solutions by UK Hosting. |
|
|
|
![]() |
| Tags |
| include, navigation, php |
| Thread Tools | |
| Display Modes | |
|
|