You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gilles Gros <gi...@whitepj.com> on 2002/08/20 00:15:28 UTC
rewrite Question
Hi,
We are curretly using the rewrite engine.
We are planning to change the way our URL are handled.
We are struggling with the following :
How can we rewrite : http://server.site.com/HELP/login.php?id=xxx to
http://server.site.com/xxx/HELP/login.php?id=xxx
Thank you for any hint.
Gilles
---------------------------------------------------------------------
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
RE: rewrite Question
Posted by Gilles Gros <gi...@whitepj.com>.
Thanks,
I found the right syntax :
RewriteEngine On
RewriteCond %{QUERY_STRING} id=(.*)
RewriteRule ^/HELP/login.php /%1/HELP/login.php?%{QUERY_STRING}
Thnak you for the hint.
Gilles
> -----Original Message-----
> From: Joshua Slive [mailto:joshua@slive.ca]
> Sent: Monday, August 19, 2002 3:39 PM
> To: users@httpd.apache.org; gillesg@whitepj.com
> Subject: RE: rewrite Question
>
>
>
> On Mon, 19 Aug 2002, Gilles Gros wrote:
>
> > yes, but I need to find what was the xxx, because it can change.
> >
> > In fact xxx is dynamic per user. I was looking at :
> >
> > RewriteEngine On
> > RewriteRule ^/HELP/login.php?id=(.*) /$1/HELP/login.php?id=$1
> >
> > but the URI in the rewrite engine does not contain ?id=xxx
> >
> > Any other idea ?
>
> Ahhh... It help when you provide the details.
>
> RewriteEngine On
> RewriteCond $QUERY_STRING (.*)
> RewriteRule ^/HELP/login.php /%1/HELP/login.php
>
> Where %1 is a back-reference to the RewriteCond match.
>
> 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
RE: rewrite Question
Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 19 Aug 2002, Gilles Gros wrote:
> yes, but I need to find what was the xxx, because it can change.
>
> In fact xxx is dynamic per user. I was looking at :
>
> RewriteEngine On
> RewriteRule ^/HELP/login.php?id=(.*) /$1/HELP/login.php?id=$1
>
> but the URI in the rewrite engine does not contain ?id=xxx
>
> Any other idea ?
Ahhh... It help when you provide the details.
RewriteEngine On
RewriteCond $QUERY_STRING (.*)
RewriteRule ^/HELP/login.php /%1/HELP/login.php
Where %1 is a back-reference to the RewriteCond match.
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
RE: rewrite Question
Posted by Gilles Gros <gi...@whitepj.com>.
yes, but I need to find what was the xxx, because it can change.
In fact xxx is dynamic per user. I was looking at :
RewriteEngine On
RewriteRule ^/HELP/login.php?id=(.*) /$1/HELP/login.php?id=$1
but the URI in the rewrite engine does not contain ?id=xxx
Any other idea ?
Gilles
> -----Original Message-----
> From: Joshua Slive [mailto:joshua@slive.ca]
> Sent: Monday, August 19, 2002 3:26 PM
> To: users@httpd.apache.org; gillesg@whitepj.com
> Subject: Re: rewrite Question
>
>
>
> On Mon, 19 Aug 2002, Gilles Gros wrote:
>
> > Hi,
> >
> > We are curretly using the rewrite engine.
> > We are planning to change the way our URL are handled.
> >
> > We are struggling with the following :
> >
> > How can we rewrite : http://server.site.com/HELP/login.php?id=xxx to
> > http://server.site.com/xxx/HELP/login.php?id=xxx
>
> RewriteEngine On
> RewriteRule ^/HELP/login.php /xxx/HELP/login.php
>
> The query string should automatically get carried through.
>
> This would probably work too:
>
> Alias /HELP/login.php /xxx/HELP/login.php
>
> 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
Re: rewrite Question
Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 19 Aug 2002, Gilles Gros wrote:
> Hi,
>
> We are curretly using the rewrite engine.
> We are planning to change the way our URL are handled.
>
> We are struggling with the following :
>
> How can we rewrite : http://server.site.com/HELP/login.php?id=xxx to
> http://server.site.com/xxx/HELP/login.php?id=xxx
RewriteEngine On
RewriteRule ^/HELP/login.php /xxx/HELP/login.php
The query string should automatically get carried through.
This would probably work too:
Alias /HELP/login.php /xxx/HELP/login.php
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