| | |
Relative Paths and Subdomains
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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.
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.
![]() |
Similar Threads
- How do you bypass school/corporate internate filters (Network Security)
- relative paths in c (C)
- Document Root paths and circles (Search Engine Optimization)
- jpeg and link problems (HTML and CSS)
- Class File, making directories... relative to (Java)
- Files (Java)
Other Threads in the PHP Forum
- Previous Thread: Help with Login Box
- Next Thread: Just a simple question.
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube





