The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

.htaccess files!

SikarianSikarian Registered User regular
edited October 2007 in Help / Advice Forum
I'm sure someone out there knows about em :) Here's what I'm trying to accomplish. I have two domain names, lets say "Domain1.com" and "domain2.us". I want them both hosted on the same webserver (because I'm cheap.) Right now, Domain1.com is what is being pointed to and is using the httpdocs folder on the server (It's a Linux-plesk web host). I've spoken to the host, and they are gonna rig up the DNS to point domain2.us to the same server...I just need to find a way to fiddle with the .htaccess files.

Essentially, I need it so that if someone goes to domain1.com, it will put them in httpdocs1 and view all of the html stuff there. If they go to domain2.us, it will put them in httpdocs2 and view all of the html there.


Any tips? Ideas?

Sikarian on

Posts

  • Jimmy KingJimmy King Registered User regular
    edited October 2007
    That would be a virtualhost and you can't do that with .htaccess. That has to be done in the main httpd config. Most likely you can configure virtualhosts like that through plesk although I can't tell you how/where to do it.

    Jimmy King on
  • PirateJonPirateJon Registered User regular
    edited October 2007
    Easily. In windows land it's called "host headers" and in apache it's called "name based vHost".

    Dunno about your specific config, but that should give you something to go(ogle) on.

    PirateJon on
    all perfectionists are mediocre in their own eyes
  • SikarianSikarian Registered User regular
    edited October 2007
    Got it figured out.


    RewriteEngine On

    RewriteCond %{HTTP_HOST} domain1.com$ [NC]
    RewriteCond %{REQUEST_URI} !^/site1/.*$
    RewriteRule ^(.*)$ /site1/$1 [L]

    RewriteCond %{HTTP_HOST} domain2.us$ [NC]
    RewriteCond %{REQUEST_URI} !^/site2/.*$
    RewriteRule ^(.*)$ /site2/$1 [L]



    Works like a charm. Lockable thread

    Sikarian on
Sign In or Register to comment.