httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwards Jim <...@ur.se>
Subject RE: [users@httpd] mod_rewrite on VirtualHost
Date Fri, 12 Dec 2003 12:10:30 GMT
Here is the VirtualHost object in httpd.conf:

    <VirtualHost my.domain.com:80>
        DocumentRoot /path/to/vhost
        ServerName my.domain.com
        DirectoryIndex index.php index.html
        RewriteEngine On
	RewriteRule ^([A-Za-z0-9_]+)*$ /folder/$1.php [R,L]
	RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)*$ /folder/$2.php?parent1=$1 [R,L]
	RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9_]+)*$ /folder/$3.php?parent1=$1&parent2=$2
[R,L]
	RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9_]+)/([A-Za-z0-9_]+)*$ /folder/$4.php?parent1=$1&parent2=$2&parent3=$3
[R,L]
    </VirtualHost>

Jim

-----Original Message-----
From: Robert Andersson [mailto:robert@profundis.nu] 
Sent: den 12 december 2003 03:57
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_rewrite on VirtualHost

Edwards Jim wrote:
> I'm wondering if anyone has worked with URL rewriting within
> a VirtualHost?

/me raise hand

> I've been able to get the rewrite engine to work on the root web
> but the same rules do not work when applied to the VirtualHost.

There might be slight variations because of different scopes. Please show us
the rules (and also how they are placed in the VHost), and we might be able
to help you.

Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message