Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
<base href="SITENAME" /> = RELATIVE LINKS THAT WORK SITEWIDE
Old 08-29-2005, 01:36 PM <base href="SITENAME" /> = RELATIVE LINKS THAT WORK SITEWIDE
Novice Talker

Posts: 5
Trades: 0
<base href="SITENAME" /> = RELATIVE LINKS THAT WORK SITEWIDE

Wrote a simple howto to prevent having to rely on internal, sitewide absolute links. Only drawback is if you use subdomains and you want to preserve the subdomain path in the address bar. Really, really simple tip that saves alot of time in case need to preserve your relative links.

http://computing.adviceuniverse.com/...50822basehref/

-Eric
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
cberic3 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-29-2005, 03:49 PM
TwiztedFake's Avatar
Skilled Talker

Posts: 77
Location: Central, IL
Trades: 0
By default your server will always look at the root directory. (base href) Unless you tell it otherwise.
If your file is in /images then it will look in domain.com/images for the file. With or Without the base href!

Now if your page is in /images and your file is in /photo then it will look in its root directory for the file. Which in this case would be /images !

Quote:
Most hints on the net say to use absolute paths when you link your style sheets and images on sub domains, but this will come to bite you if you have masked domain names or you change your domain name completely, leaving you having to update every single absolutely linked file on your website.
Even if you use the base href tag, when you change your domain name you still have to go back and change every base href tag on every page of your site. So where are you really saving time?
__________________

Please login or register to view this content. Registration is FREE
TwiztedFake is offline
Reply With Quote
View Public Profile Visit TwiztedFake's homepage!
 
Old 08-29-2005, 04:34 PM
Novice Talker

Posts: 5
Trades: 0
well for one, it saves a ton of time from having to type out full local urls while you are designing a site.

if you use templates that affect hundreds of pages, all you have to do is make the change in the template and the changes will be reflected in every page based on the template.

-Eric
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
cberic3 is offline
Reply With Quote
View Public Profile
 
Old 08-29-2005, 05:00 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
How does it?

There is simply no need to put full local urls in the document. Using root relative or document relative paths is perfectly usable and all user agents will normalise the url before accessing the URI.

The only time the <base> could be set for a useful purpose is when there are several domains aliased to the one site and no server side redirection can be used.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-29-2005, 05:34 PM
TwiztedFake's Avatar
Skilled Talker

Posts: 77
Location: Central, IL
Trades: 0
Very well said chrishirst. That is the point I was trying to make. By adding the base href then there is a need to go and change something if you were to switch domains.
__________________

Please login or register to view this content. Registration is FREE
TwiztedFake is offline
Reply With Quote
View Public Profile Visit TwiztedFake's homepage!
 
Reply     « Reply to <base href="SITENAME" /> = RELATIVE LINKS THAT WORK SITEWIDE
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15126 seconds with 12 queries