httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nigel Peck - MIS Web Design" <ni...@miswebdesign.com>
Subject RE: [users@httpd] mod_rewrite RewriteRule
Date Fri, 17 Oct 2003 11:45:45 GMT
Having been away and RTFM I see that when mod_rewrite is used in a .htaccess it restarts the
API phase which I guess is why this is happening and the rules are getting run twice. Any
solutions?

Would putting the rules in a virtual server block but not in a Directory block/.htaccess solve
this?

Cheers,
Nigel

> -----Original Message-----
> From: Nigel Peck - MIS Web Design [mailto:nigel@miswebdesign.com]
> Sent: 17 October 2003 11:47
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] mod_rewrite RewriteRule
> 
> 
> If I do the following (pseudo) rules in mod_rewrite I get an endless loop:
> 
> Rewrite /forumX/           viewforum.php?f=X  [L]
> Rewrite viewforum.php?f=X  /forumX/           [L,R]
> 
> Shouldn't the second rule be ignored when forumX is called 
> because of the L flag? Or once the rule has been applied is the 
> URL then run through the rules again? Is there a flag to say 
> "last call and don't start again for the new url"?
> 
> What I want is to have a transparent redirect for formX to 
> viewforum.php?f=X and a location (browser) redirect to forumX for 
> direct calls to viewforum.php.
> 
> Is there a way to do this through some flag or other?
> 
> Cheers
> Nigel
> 
> > -----Original Message-----
> > From: Joshua Slive [mailto:joshua@slive.ca]
> > Sent: 16 October 2003 19:51
> > To: users@httpd.apache.org
> > Subject: Re: [users@httpd] mod_rewrite RewriteRule
> > 
> > 
> > 
> > On Thu, 16 Oct 2003, Nigel Peck - MIS Web Design wrote:
> > 
> > > Can someone please tell me why this rule isn't working?
> > >
> > > RewriteRule  ^viewforum\.php\?f=([0-9]+)$  /forum$1/  [L,R]
> > 
> > Because RewriteRule doesn't match against the query string.  You need
> > something like
> > 
> > RewriteCond %{QUERY_STRING} ^f=([0-9]+)$
> > RewriteRule ^viewforum\.php /forum%1/ [L,R]
> > 
> > Joshua.
> > 
> > ---------------------------------------------------------------------
> > 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
> 


---------------------------------------------------------------------
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