SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: sub-sites
-
Apr 21, 2009, 20:43 #1
sub-sites
I am building a couple more sites to add to my portfolio but I have no money to buy domain names for them so I want to temporarily host them on my portfolio eg: myportfolio.com/subsite1
I am unsure how to go about this since these other websites have a root based link structure (href="/page1"), so the "/" would take it to the root if it had its own domain, but since I am hosting it on my portfolio site it would go from portfolio.com/subsite1/page1 - the "/" would take you to portfolio.com, but I want the "/" in my sub site to take me to portfolio.com/subsite1.
how would I go about doing this.... could the htaccess file do this?
-
Apr 21, 2009, 20:54 #2
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
No, it can't. There's no way a regular expression could differentiate between a link to "/page1" in one site and "/page1" in another site. The requested URI in the HTTP request is exactly the same.
Either use relative links, full URLs, or host these sites on subdomains of your main domain instead of subfolder.Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Apr 21, 2009, 21:27 #3
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You could write a quick php script which would scan all the files in a directory, and replace href="/ with href="/subsite1
-
Apr 21, 2009, 21:52 #4
Thanks for the info. A script could work. I will create a subdomain instead, I looked into it and it seems pretty easy to do. I should have looked into subdomains earlier. They are useful.
Bookmarks