SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: sub-sites

Hybrid View

  1. #1
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    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.

  3. #3
    SitePoint Wizard bronze trophy
    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

  4. #4
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •