The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Fully qualified internal links
DeaPeaJay
post Sep 23 2006, 02:27 PM
Post #1


Advanced Member
****

Group: Members
Posts: 103
Joined: 21-September 06
From: East Tennessee - USA
Member No.: 191



My question is, I've got pages in sub directories, and rewritten URLs out the wazoo. I'd like to get all the links on the main menu for instance to be the same across all pages so i can use a PHP include for the menu. The only way I know to do that is to make the links link to the fully qualified path. (http://www.emmasbridaljewelry.com/inner/bridal/necklaces/ instead of "inner/bridal/necklaces/".

I remember long ago hearing that that was a bad thing to do. I can't remember why it was bad though. Is it bad? That's my question.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 23 2006, 02:57 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,648
Joined: 10-August 06
Member No.: 7



QUOTE(DeaPeaJay @ Sep 23 2006, 09:27 PM) *

My question is, I've got pages in sub directories, and rewritten URLs out the wazoo. I'd like to get all the links on the main menu for instance to be the same across all pages so i can use a PHP include for the menu. The only way I know to do that is to make the links link to the fully qualified path. (http://www.emmasbridaljewelry.com/inner/bridal/necklaces/ instead of "inner/bridal/necklaces/".


You could use "/bridal/necklaces/" (note the beginning slash) in the included menu. See also http://htmlhelp.com/faq/html/basics.html#relative-url

QUOTE
I remember long ago hearing that that was a bad thing to do. I can't remember why it was bad though. Is it bad? That's my question.


I will not work offline. If you test your PHP pages on a local/offline server the current site's root URL might be something like "http://localhost/foo/" , and then "/bridal/necklaces/" becomes "http://localhost/bridal/necklaces/" which may not be what you want.

This is an annoyance to me. An unpractical solution is to let a PHP script write out different URL in the included menu, depending on which directory the including web page is located. A possibly better idea is to use "/foo/bridal/necklaces/" in the inclusion file when testing the pages offline, then remove "foo/" before uploading to the web server.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 11:03 AM