httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea" <softw...@polin.it>
Subject Re: [users@httpd] redirecting to error page based on URL string
Date Tue, 11 Mar 2003 15:39:48 GMT
okay,
use:

RewriteEngine On
# if the query string contains "guest=yes"
RewriteCond %{QUERY_STRING} guest=yes [NC]
# redirect the request to another place without the query string
RewriteRule . http://me.something.com/? [L]

Some thoughts:

a)
I'd use guest=yes because using only "guess" it could be possible that the
query string contains the word guess for other query arguments

b)
as you can see I added a ? at the end of the rewrite rule.
It's a trick to avoid that the rewrite parser will attach the whole query
string when he makes the redirection.

:-) Mr. Andrea Rossignoli



----- Original Message -----
From: "Martin Hudec" <corwin@corwin.sk>
To: <users@httpd.apache.org>
Cc: "Andrea" <software@polin.it>
Sent: Tuesday, March 11, 2003 17:25
Subject: Re: [users@httpd] redirecting to error page based on URL string


> thanks :)
>
> so my .htaccess is like this:
>
> RewriteEngine On
> RewriteCond %{QUERY_STRING} guest
> RewriteRule XXXXXXX         http://me.something.com/
>
> :) i am absolutely new to this :)...
> so i am checking if query contains guest, and if yes, following rewrite
rule
> will apply (what should be in XXXXXXX?) and redirects it to main site
>
> M.
>
> On Tuesday March 11 2003 14:42, Andrea wrote:
> > Hi,
> >
> > yes it's possible:
> >
> > Use something like this into an .htaccess file:
> >
> > # Check if the query string contains guest=yes
> > RewriteCond %{QUERY_STRING} guest=yes [NC]
> > RewriteRule etc etc
> >
> >
> > ~Andrea
> >
> > ----- Original Message -----
> > From: "Martin Hudec" <corwin@corwin.sk>
> > To: <users@httpd.apache.org>
> > Sent: Tuesday, March 11, 2003 16:21
> > Subject: [users@httpd] redirecting to error page based on URL string
> >
> > > Hello all,
> > >
> > > is it possible to make redirection based on part of url to error page?
> > > url like www.something.com/index.php?room=xxx&guest=yes
> > > I want to look for that "guest".
> > >
> > > thanks for any help
> > >
> > > --
> > > Martin Hudec
> > > ----------------------------------
> > >
> > > :@: corwin@corwin.sk
> > > :w: http://www.corwin.sk
> > > :m: +421.907.303.393
> > >
> > > "In google non est, ergo non est."
> > > - unknown IRC operator
> > > ----------------------------------
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
> --
> Martin Hudec
> ----------------------------------
> :@: corwin@corwin.sk
> :w: http://www.corwin.sk
> :m: +421.907.303.393
>
> "In google non est, ergo non est."
> - unknown IRC operator
> ----------------------------------
>
> ---------------------------------------------------------------------
> 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