Rewriting parked domains to avoid buying more hosting?

Discussion in 'Apache' started by Kerosene, Jun 15, 2006.

  1. #1
    There's a good chance this is a stupid question...

    Can I make a parked domain act like a cpanel 'addon' domain... without paying my host?

    Let's say parkeddomain.com is parked at mywebsite.com.
    Is there anyway I can use mod rewrite to redirect a parked domain (to a directory on my main domain) AND keep the parked domain url in the users browser.

    e.g. you type in: parkeddomain.com/purple.html
    The page you see is: mywebsite.com/parked/purple.html
    BUT parkeddomain.com/purple.html is shown in browser.

    Any way to do this?

    I can get the redirect to work, but that was a fluke:
    RewriteCond %{HTTP_HOST} ^parkeddomain\.com [OR]
    RewriteCond %{HTTP_HOST} ^www\.parkeddomain\.com
    RewriteRule ^(.*)$ http://www.mywebsite.com/parked/$1 [R=permanent,L]
    
    Code (markup):
     
    Kerosene, Jun 15, 2006 IP
  2. BigTicket

    BigTicket Peon

    Messages:
    197
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I am not sure where you have your domain registered, but I know with Godaddy at least you can do a domain forward with masking and that would pretty much do what you are asking. I have not used this so am not sure how it would act with sub directories, but I suppose it should be the same.

    The way that you are trying to do it with mod-rewrite, I believe would me that you would already have to be hosting that domain so that you can redirect it. ??
     
    BigTicket, Jun 15, 2006 IP
  3. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #3
    My domain is registered with the same people that provide my hosting - and I'm sure they can setup up domain forwarding, I just don't want to pay for it. :D

    I have another site with 2 domains pointing to the same host account - but I've used PHP to dish up different content depending on the domain, so I'm effectively getting one of those domains forwarded for nothing. I'm just trying to do the same thing, but with mod rewrite instead of PHP on each page.

    All this just to save a few $ :p
     
    Kerosene, Jun 15, 2006 IP
  4. BigTicket

    BigTicket Peon

    Messages:
    197
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Do you have a acount area for your domain that you have control over, have you checked to see if it is something that you can do quickly yourself (I am sure you have).

    I don't think it's something out of the possibility with Mod-rewrite, but my knowledge of it is limited. I am sure some of the more experienced guys around here could shed some light on it.
     
    BigTicket, Jun 15, 2006 IP
  5. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #5
    It can easily be done in cPanel by using the "addon domain' feature (I think)... but to have this enabled I have to pay a fee to the hosting company.

    I guess if it was easy to do using mod rewrite, then everyone would be doing it.
     
    Kerosene, Jun 15, 2006 IP