|
|
|
|
|
|
|
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
![]() |
#1 |
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
|
Ray's Webmaster School, Tip #241: Link local links locally
This is one of those little tips I've been posting
for many years and most professional webmasters know it, but I still come across a few sites where people have put in a lot of extra effort or run into a big hassle because they didn't know about local links: Let's say your web pages currently link to each other with long ass links that look something like this: <a href="http://www.somehotyoungbabe.com/members/"> Let's say some day you bought ahotbabe.com or for some reason you copied your site over to somehotyoungbabe.net also. With the links like you have them now you'd have to change all of your links to put in the new domain name. Or, perhaps you copied and pasted just a small part of one of your pages to another site you started. Again, all of the links would be pointing to the wrong domain name and you'd have to change them. To avoid this hassle, most professional webmasters leave the domain name out of the link entirely, like this: <href="/members/"> This also has the advantage that it's a lot shorter to type, so adding new links is faster. Here are the two links together for comparison: <href="http://www.somehotyoungbabe.com/members/"> <a href="/members/"> Both links work the same way, but the second form is a lot faster, more portable, and makes your source code easier to read. If you missed last week's tip, here's a review: This is the URL of a FILE named "members": http://www.somehotyoungbabe.com/members With a slash on the end, it's a DIRECTORY URL: http://www.somehotyoungbabe.com/members/ If you leave the ending slash off of directory names Apache can SOMETIMES detect your error and redirect the user to the correct URL, but that takes extra time and server load, and it doesn't always work. So always remember, directory URLs end with a slash! |
![]() |
![]() |
![]() |
#2 |
Jim? I heard he's a dirty pornographer.
Join Date: Aug 2003
Location: Washington, DC
Posts: 2,706
|
I didn't know you were doing webmaster tips. Do you have an archive?
![]() |
![]() |
![]() |
![]() |
#3 |
Registered User
|
LOL I saw the title of this and thought it was another one of those scripts to get the members here to look at the post. Ray is my name lol.
|
![]() |
![]() |
![]() |
#4 |
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
another use for <base href="http://fulldomain.com/"> as well.
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
![]() |
![]() |
![]() |
|
|