Right, but here's the problem : REQUEST_URI keeps getting set to
/index.php/index.php/index.php/....
I thought REQUEST_URI should endup as /path/on/system? Is this a
problem with apache on redhat 8? I'm almost positive this worked fine a
little while ago before my last round of updates. When the rewrite is
complete, what can I use to test the final result of a RewriteRule? can
I set the result to an environment variable and test that?
Thanks
Marc
On Tue, 2003-04-15 at 02:11, Andrea Rossignoli wrote:
> Hi,
>
> >I am trying to setup some rewriting, but I can't get out of an infinite
> >loop. Here are my rules:
> >
> >RewriteCond %{HTTP_HOST} ^[^.]+\.server\.com$
> >RewriteCond %{REQUEST_URI} !^/var/www/hosts
> >RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
> >RewriteRule ^([^.]+)\.server\.com(.*) /var/www/hosts/%{HTTP_HOST}/docs
> [L]
>
> If I'm right you want that every request to a subdomain is redirected to a
> particular directory.
> So put this code into an .htaccess or inside a directory block of your
> document root into your httpd.conf
>
> RewriteEngine On
>
> # Extract the subdomain from the host name
> RewriteCond %{HTTP_HOST} ^([^.]+)\.server\.com$ [NC]
> # Verify that it's not www because it's the main server
> RewriteCond %1 !^www$ [NC]
> # Verify that an internal request was not in progress
> RewriteCond %{REQUEST_URI} !^/var/www/hosts [NC]
> # Okay, finally make the redirection
> RewriteRule (.*) /var/www/hosts/%1/docs/$1 [L]
>
> Remember that /var/www/hosts/etcetc is not an absolute directory path,
> but it's relative to your document root.
>
> Maybe it should be possible to do the same thing with some virtual host
> directives,
> but you asked for mod_rewrite and I showed an example.
>
> Hope it helped,
>
> Thank you,
> :-) Andrea
>
>
> ----- Original Message -----
> From: "Marc Boorshtein" <mboorshtein@yahoo.com>
> To: <users@httpd.apache.org>
> Sent: Monday, April 14, 2003 23:16
> Subject: [users@httpd] Stop ReWrite Infinite Loops?
>
>
>
> ---------------------------------------------------------------------
> 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
--
Marc Boorshtein <mboorshtein@yahoo.com>
|