You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by tech user <te...@yahoo.com.cn> on 2007/09/24 14:28:59 UTC

[users@httpd] help about a rewrite rule

Hello,

I need to rewrite a request url,but I'm not sure how to do it correctly.
The incoming url form is like,

http://www.example.com/script?param1=xx&param2=yy

The desired rewritten url is,

http://www.example.com/xx_yy.html


Please help me the correct syntax.Thanks in advance.



      Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


---------------------------------------------------------------------
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: [users@httpd] help about a rewrite rule

Posted by tech user <te...@yahoo.com.cn>.
Thanks a lot.It works fine.

--- Axel-Stéphane  SMORGRAV <Ax...@europe.adp.com> wrote:

> RewriteEngine on
> RewriteCond %{QUERY_STRING} ^mid=(\d+)$
> RewriteRule ^/movie_play.php /movie%1.html?  [R]
>   



      Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


---------------------------------------------------------------------
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: [users@httpd] help about a rewrite rule

Posted by Axel-Stéphane SMORGRAV <Ax...@europe.adp.com>.
RewriteEngine on
RewriteCond %{QUERY_STRING} ^mid=(\d+)$
RewriteRule ^/movie_play.php /movie%1.html?  [R]
  
-----Message d'origine-----
De : tech user [mailto:techwww@yahoo.com.cn] 
Envoyé : mardi 25 septembre 2007 08:18
À : users@httpd.apache.org
Objet : Re: [users@httpd] help about a rewrite rule


--- Joshua Slive <jo...@slive.ca> wrote:

> 
> See:
> http://wiki.apache.org/httpd/RewriteQueryString
> 

Thank you so much Joshua.
I want to rewrite the url from,
http://www.example.com/movie_play.php?mid=45298

to,
http://www.example.com/movie45298.html

I added the commands in httpd.conf:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^mid=(\d+)$
RewriteRule ^/movie_play.php /movie%1.html  [R,L]

but this can't work.I got the rewritten url as,
http://www.example.com/movie45298.html?mid=45298

the `?mid=45298` is not needed.
Please give more suggestions,thanks.





      Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


---------------------------------------------------------------------
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: [users@httpd] help about a rewrite rule

Posted by tech user <te...@yahoo.com.cn>.
--- Joshua Slive <jo...@slive.ca> wrote:

> 
> See:
> http://wiki.apache.org/httpd/RewriteQueryString
> 

Thank you so much Joshua.
I want to rewrite the url from,
http://www.example.com/movie_play.php?mid=45298

to,
http://www.example.com/movie45298.html

I added the commands in httpd.conf:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^mid=(\d+)$
RewriteRule ^/movie_play.php /movie%1.html  [R,L]

but this can't work.I got the rewritten url as,
http://www.example.com/movie45298.html?mid=45298

the `?mid=45298` is not needed.
Please give more suggestions,thanks.





      Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html


---------------------------------------------------------------------
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: [users@httpd] help about a rewrite rule

Posted by Joshua Slive <jo...@slive.ca>.
On 9/24/07, tech user <te...@yahoo.com.cn> wrote:
> Hello,
>
> I need to rewrite a request url,but I'm not sure how to do it correctly.
> The incoming url form is like,
>
> http://www.example.com/script?param1=xx&param2=yy
>
> The desired rewritten url is,
>
> http://www.example.com/xx_yy.html
>
>
> Please help me the correct syntax.Thanks in advance.

See:
http://wiki.apache.org/httpd/RewriteQueryString

It is unclear to me exactly what you mean by "incoming" url and
"desired" url. What exactly is the user going to type in their browser
(or in their links), what do you want them to see in the URL bar of
their browser, and what exactly needs to be called on the server?

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