Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 82236 invoked from network); 28 Jul 2007 06:31:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jul 2007 06:31:23 -0000 Received: (qmail 37557 invoked by uid 500); 28 Jul 2007 06:31:12 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 37541 invoked by uid 500); 28 Jul 2007 06:31:12 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 37529 invoked by uid 99); 28 Jul 2007 06:31:12 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 23:31:12 -0700 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.198.187] (HELO rv-out-0910.google.com) (209.85.198.187) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jul 2007 06:31:05 +0000 Received: by rv-out-0910.google.com with SMTP id f1so148013rvb for ; Fri, 27 Jul 2007 23:30:44 -0700 (PDT) Received: by 10.141.76.21 with SMTP id d21mr1167237rvl.1185604243362; Fri, 27 Jul 2007 23:30:43 -0700 (PDT) Received: by 10.141.43.4 with HTTP; Fri, 27 Jul 2007 23:30:43 -0700 (PDT) Message-ID: Date: Sat, 28 Jul 2007 09:30:43 +0300 From: "Marc Jacobs" To: users@httpd.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4044_1342545.1185604243345" References: X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Re: help on apache mod_rewrite ------=_Part_4044_1342545.1185604243345 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi everyone, I have a problem with apache, perhaps you can help... I would be glad if you did. I'm not an expert on the subject, so forgive me if I'm sounding naive.... I need to create 1 virtual host that runs multiple sites (siteA.com) & siteB.com) located at different paths in the host. In order to achieve this: - I've already configured DNS for these domains - I've created a virtual host named: sites (/var/www/vhosts/sites/httpdocs) - Under sites, I have 2 seperate directories: - siteA and SiteB - Now I want to configure apache so that, the virtual host will resolve correct paths for each of these domains (siteA.com & SiteB.com) - However, no matter what I did in httpd.conf, the virtual host won't resolve the right folders for these domains See the part of httpd.conf that relates to this virtual host: DocumentRoot /var/www/vhosts/sites/httpdocs ServerName sites ServerAlias siteA.com www.siteA.com siteB.com www.SiteB.com RewriteEngine On # THIS IS NOT WORKING: this was intended to take you to the right path when you type siteA.com OR www.siteA.com RewriteCond %{HTTP_HOST} ^siteA\.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www\.siteA\.com$ [NC] RewriteRule ^/var/www/vhosts/sites/httpdocs(.*) /var/www/vhosts/sites/httpdocs/siteA$1 # THIS IS NOT WORKING: this was intended take you to the right path when you type siteB.com OR www.siteB.com RewriteCond %{HTTP_HOST} ^siteB\.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www\.siteB\.com$ [NC] RewriteRule ^/var/www/vhosts/sites/httpdocs(.*) /var/www/vhosts/sites/httpdocs/siteB$1 I think I'm making a mistake with the RewriteRule part, rather than RewriteCond. I tried to understand these (.*)!$ stuff... But they're not very intuitive, i'm afraid. Thank for your time. Cheers, ------=_Part_4044_1342545.1185604243345 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi everyone,

I have a problem with apache, perhaps you can help... I would be glad
if you did. I'm not an expert on the subject, so forgive me if I'm
sounding naive....

I need to create 1 virtual host that runs multiple sites (siteA.com) &
siteB.com) located at different paths in the host.

In order to achieve this:
- I've already configured DNS for these domains
- I've created a virtual host named: sites (/var/www/vhosts/sites/httpdocs)
- Under sites, I have 2 seperate directories:
- siteA and SiteB
- Now I want to configure apache so that, the virtual host will
resolve correct paths for each of these domains (siteA.com &
SiteB.com)
- However, no matter what I did in httpd.conf, the virtual host won't
resolve the right folders for these domains

See the part of httpd.conf that relates to this virtual host:

<VirtualHost *:80>
DocumentRoot /var/www/vhosts/sites/httpdocs
ServerName sites
ServerAlias siteA.com www.siteA.com siteB.com www.SiteB.com
RewriteEngine On
# THIS IS NOT WORKING: this was intended to take you to the right path
when you type siteA.com OR www.siteA.com
RewriteCond %{HTTP_HOST} ^siteA\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.siteA\.com$ [NC]
RewriteRule ^/var/www/vhosts/sites/httpdocs(.*)
/var/www/vhosts/sites/httpdocs/siteA$1
# THIS IS NOT WORKING: this was intended take you to the right path
when you type siteB.com OR www.siteB.com
RewriteCond %{HTTP_HOST} ^siteB\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.siteB\.com$ [NC]
RewriteRule ^/var/www/vhosts/sites/httpdocs(.*)
/var/www/vhosts/sites/httpdocs/siteB$1
</VirtualHost>


I think I'm making a mistake with the RewriteRule part, rather than
RewriteCond. I tried to understand these (.*)!$ stuff... But they're
not very intuitive, i'm afraid.

Thank for your time.

Cheers,

------=_Part_4044_1342545.1185604243345--