Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 93287 invoked from network); 28 Jul 2007 22:13:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jul 2007 22:13:16 -0000 Received: (qmail 35047 invoked by uid 500); 28 Jul 2007 22:13:09 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 34995 invoked by uid 500); 28 Jul 2007 22:13:09 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 34984 invoked by uid 99); 28 Jul 2007 22:13:09 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jul 2007 15:13:09 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [82.94.236.173] (HELO loco.helderhosting.nl) (82.94.236.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jul 2007 22:13:00 +0000 Received: from [192.168.2.13] (bas3-toronto01-1177779262.dsl.bell.ca [70.51.124.62]) by loco (Postfix) with ESMTP id D5BD410E0464 for ; Sun, 29 Jul 2007 00:12:37 +0200 (CEST) Message-ID: <46ABBF69.6070807@adaniels.nl> Date: Sat, 28 Jul 2007 18:12:57 -0400 From: Arnold Daniels User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: help on apache mod_rewrite References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------010904010207090507080906" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------010904010207090507080906 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Marc, This is not the correct list for you question. This list is for developers of the apache http server only. Use to following to get a bit more info of what is going on: RewriteLog /var/log/rewrite.log RewriteLogLevel 2 The `stuff` you are talking about are regular expressions and are not exclusive to mod_rewrite. Check http://www.regular-expressions.info for a tutorial. Best regards, Arnold Marc Jacobs wrote: > 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, > --------------010904010207090507080906 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Marc,

This is not the correct list for you question. This list is for developers of the apache http server only.

Use to following to get a bit more info of what is going on:
RewriteLog /var/log/rewrite.log
RewriteLogLevel 2
The `stuff` you are talking about are regular expressions and are not exclusive to mod_rewrite. Check http://www.regular-expressions.info for a tutorial.

Best regards,
Arnold


Marc Jacobs wrote:
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,
  
--------------010904010207090507080906--