SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Feb 2005
    Location
    Maine
    Posts
    244
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Redirect Second Domain to Subfolder on Primary Domain?

    Hey,

    I'm starting programming on a new project soon, but there's this one kink I want to work out before I write any code. For all intents and purposes, I'm starting a free web hosting site. So a user has his website at freehost.com/sitename. But then he buys an upgrade where he can have his own domain, sitename.com. It is possible for me to own the domain.

    What is the best way to redirect sitename.com to freehost.com/sitename? That also means that sitename.com/subfolder will redirect to freehost.com/sitename/subfolder.

    I've read that mod_rewrite will be involved, but I haven't really found any clear guides addressing this issue specifically. Also, will things get messy if freehost.com/sitename is not an actual directory, but rather a CakePHP URL?

    Thanks.


  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,692
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    chat,

    What you're describing is called (by cPanel) an addon domain. Addon domains are usually assigned to a subdirectory of another (the master) domain. NO mod_rewrite involved, just a normal function of cPanel.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Addict
    Join Date
    Feb 2005
    Location
    Maine
    Posts
    244
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dklynn,

    I am aware of that feature, but will it work if /subdirectory is not an actual directory but a cakePHP URL?

    Thanks


  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,692
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    chat,

    A mythical directory as a DocumentRoot? No, I don't think so!

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •