Jump to content

remove query string on redirection htaccess


Recommended Posts

 

I am unable to remove query string from redirection htaccess. I have tried a lott and googled als for this..but nothing seems to work

 

Here is my code:

 

First I tried this one but didnt worked :

 

Redirect 301  /my_page.aspx?ps=22.5000&pe=44.9900 http://www.mysite.com/35-new-items

Then I tried :

 

 RewriteCond %{QUERY_STRING} (^|&)ps=

 RewriteCond %{QUERY)STRING{ (^|&)pe=4

 RewriteRule ^/?my_page\.aspx$ /35-new-items? [L,R=301]

 

But again this also didnt worked for me.

 

Then I tried this and as usual this also does not seems to work:

 

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(?:my_page\.aspx)?\?p=1 [NC]

RewriteRule ^ /35-new-items? [R=301,L]

 

Please help me !

 

I have to redirect old pages with different different query string values to the new one. The old pages are in ASPX and the new pages are in PrestaShop.

 


 

How to remove this part:

 

 ?ps=22.5000&pe=44.9900

 

from destination URL?

Link to comment
Share on other sites

×
×
  • Create New...