Vincenzo Lo Palo
Vincenzo Lo Palo

Reputation: 1381

htaccess redirect from url with querystring

when I digit this url:

http://www.mydomain/search.php?page=1&order=ASC&contract=rent&new=

url should redirect to

http://www.mydomain/rent/1

I try to add this line in my .htaccess, without success:

Redirect http://www.mydomain/search.php?page=1&order=ASC&contract=rent&new= http://www.mydomain/rent/1

thanks in advance!!!

Upvotes: 1

Views: 41

Answers (1)

jerdiggity
jerdiggity

Reputation: 3665

Add these lines instead (but you'll only need to add the first line if it isn't there already):

RewriteEngine On
RewriteCond %{QUERY_STRING} ^page=(\d+)&order=ASC&contract=rent&new=$
RewriteRule search.php /rent/%1? [L,R=301]

Upvotes: 1

Related Questions