Web Hosting Forums

Results 1 to 4 of 4

This is a discussion on .htaccess multihost in the Hosting Talk & Chit-chat forum
Ok, what I'm wanting to do is have a domain name resolve to mydomain.com/otherdomain/ WITHOUT having to actually have the first domain multihosted. In other ...

  1. #1
    Loyal Client
    Join Date
    Jan 2004
    Location
    I'm right behind you....
    Posts
    387

    .htaccess multihost

    Ok, what I'm wanting to do is have a domain name resolve to mydomain.com/otherdomain/ WITHOUT having to actually have the first domain multihosted.

    In other words, when someone types www.otherdomain.info they would end up at mydomain.com/otherdomain/ and still have the browser showing otherdomain.info. I'm pretty sure there's a way to "fake" multihosting like this with .htaccess, but I don't know it.

    I searched the archives and found this:


    RewriteEngine on

    rewritecond %{HTTP_HOST}

    .*otherdomain\.info$
    rewritecond %{REQUEST_URI}

    !^/otherdomain/
    RewriteRule (.*) /otherdomain/$1


    However, that didn't work (Internal Server Error when trying otherdomain.com and the error log says /public_html/.htaccess: RewriteCond: bad argument line '%{HTTP_HOST}'

    I'm not wanting to actually multihost the other site (I'd rather have a seperate account for it), but the domain is registered and I'd like to at least have it pointing to a "Under Construction" page or something for the time being.
    Last edited by Galen; 05-28-2004 at 05:19 AM.

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    I'm not sure if your post is broken up weird because on the forum or if it is copied from the .htaccess, but it should look like this:
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} .*otherdomain\.info$
    RewriteCond %{REQUEST_URI} !^/otherdomain/
    RewriteRule (.*) /otherdomain/$1
    If you have those breaks the same way in the .htaccess that's probably your problem. I don't see anything that looks wrong with it otherwise.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    Loyal Client
    Join Date
    Jan 2004
    Location
    I'm right behind you....
    Posts
    387
    Ah, I see. That's the way it was in the post I found it in, so that's how I copied it. The breaks didn't even occur to me. THANKS!

  4. #4
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    You're welcome. Glad you got it working.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

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
  •