Relative Paths and Subdomains

Reply

Join Date: Jun 2005
Posts: 54
Reputation: senexom is an unknown quantity at this point 
Solved Threads: 0
senexom's Avatar
senexom senexom is offline Offline
Junior Poster in Training

Relative Paths and Subdomains

 
0
  #1
Jul 11th, 2005
Hi,

Perhaps this thread does not bellong in the PHP forum, but since I'm working with PHP/Apache I'll try here first.

I have setup subdomains on my site and realized that links are not relative to the wwwroot, but relative to subdomain root, I was wondering if anyone knows of a workaround (besides using Absolute URLs) perhaps using Mod_Rewrite (Which I don't know much about).

I was thinking if all else fails create a "config" file for all subdomains with wwwroot variable, but seems like too much work to modify all my pages to include this variable. But then again faster then changing it again if I add/change domain names.

Thanks in advance.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 354
Reputation: Troy is an unknown quantity at this point 
Solved Threads: 5
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: Relative Paths and Subdomains

 
0
  #2
Jul 11th, 2005
Check out HTML's BASE element. http://www.w3schools.com/tags/tag_base.asp. You'll still have to add it to every page, but it's one line in your <HEAD> -- you do not have to modify every link and image.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 54
Reputation: senexom is an unknown quantity at this point 
Solved Threads: 0
senexom's Avatar
senexom senexom is offline Offline
Junior Poster in Training

Re: Relative Paths and Subdomains

 
0
  #3
Jul 11th, 2005
Thanks Troy, I'll give it a shot, seems like it's widely supported since HTML 3.2, wierd that I've never used it or even heard of it :o
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC