Fully qualified internal links |
Fully qualified internal links |
DeaPeaJay |
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. |
Christian J |
Sep 23 2006, 02:57 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
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. |
Lo-Fi Version | Time is now: 28th April 2024 - 07:21 AM |