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.

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.