httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andoni <>
Subject [users@httpd] Re: Should be easy RewriteRule issue: mod_rewrite.
Date Mon, 24 Oct 2005 09:45:16 GMT
Hi Joshua (and all),

That worked great thanks, I had to take out the caret ^ you had at the beginning of /servMainSite
in the RewriteRule to make it work but otherwise fine. Here's what I ended up with:

  RewriteCond %{Request_URI} !^/img
  RewriteCond %{Request_URI} !^/favicon.ico
  RewriteCond %{Request_URI} !^/robots.txt
  RewriteCond %{Request_URI} !^/css
  RewriteCond %{Request_URI} !^/menu
  RewriteCond %{Request_URI} !^/servMainSite
  RewriteRule ^/(.*)$ /servMainSite?inner=$1 [R,QSA,L]

I also added the R flag. Mainly because I always have done and it has always worked for me!
The documentation is so confusing though, can you tell me if it is necessary? When I look
at the RewriteLog I find that it has now got a 302 is this what I want? Should I add a "permanent"


  ----- Original Message ----- 
  From: Joshua Slive 
  Newsgroups: gmane.comp.apache.user
  Sent: Friday, October 21, 2005 7:25 PM
  Subject: Re: Should be easy RewriteRule issue: mod_rewrite.

  On 10/21/05, Andoni <> wrote:
  > Can you please help me with this RewriteRule. I am trying to all users of my
  > website to type in:
  > and have it re-written to:
  > The slight complication is that /img, /css and /menu have to work as of
  > course does /servMainSite. At the moment I am getting an infinite loop with
  > the following:
  > #  RewriteRule !^/(servMainSite.*|img.*|css.*|menu.*)/
  > /servMainSite?inner=$1 [R,L]

  There are several ways to do this.  Here's one:

  RewriteEngine On
  RewriteCond %{Request_URI} !^/img
  RewriteCond %{Request_URI} !^/css
  RewriteRule ^/(.*) ^/servMainSite?inner=$1 [QSA,L]


  The official User-To-User support forum of the Apache HTTP Server Project.
  See <URL:> for more info.
  To unsubscribe, e-mail:
     "   from the digest:
  For additional commands, e-mail:

View raw message