how to disable query string in the rewrited url?

New to mod_rewrite? This is a good place to start.

how to disable query string in the rewrited url?

Postby mazenovi » Wed Feb 03, 2010 1:34 am

hello everybody

I've a Rewriting Rule which match fine
Code: Select all
RewriteCond %{QUERY_STRING} ^.*&?IDUSER=araujoz$
RewriteRule ^P_Perso/PP_Home.asp.*$ http://site.org/araujoz/perso/ [L,R=301]

But http://site.org/P_Perso/PP_Home.asp?IDUSER=araujoz is now redirecting to http://site.org/araujoz/perso/?IDUSER=araujoz ...

How can I disable query string on the rewrited url?
I just want to be redirect to http://site.org/araujoz/perso/

regards
mazenovi
 
Posts: 3
Joined: Wed Sep 09, 2009 11:55 pm

how to disable query string in the rewrited url?

Postby scar63 » Wed Feb 03, 2010 5:33 am

If you want disable the query string on the rewrited url, you must add "?" at the end of "http://site.org/araujoz/perso/".

So it's :

RewriteCond %{QUERY_STRING} ^.*&?IDUSER=araujoz$
RewriteRule ^P_Perso/PP_Home.asp.*$ http://site.org/araujoz/perso/? [L,R=301]

It work...
scar63
 
Posts: 1
Joined: Wed Feb 03, 2010 5:21 am


Return to Beginner's Corner

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron