301 Redirect URL Appending Query String

3 replies
Hello Friends, From yesterday, I'm trying this 301 url redirect but its not working as expected. Please help me with this. here is the .htaccess file code.

Code:
Options +FollowSymLinks +SymLinksIfOwnerMatch -MultiViews
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
RewriteBase /
rewriterule ^(.*)/(.*)\.html$ product.php?id=$1&name=$2 [L]
rewriterule ^deals/(.*)$ details.php?id=$1 [L]
rewritecond %{SERVER_PORT} 80
rewritecond %{REQUEST_URI} publisher.php
rewriterule ^(.*)$ publisher.php [L]

Redirect 301 /deals/74/product-name.html http://mydomain.com/74/product-name.html
Whenever I enter www.mydomain.com/deals/74/product-name.html", It redirects me to "www.mydomain.com/deals/74/product-name.html?id=74&name=product-name"


I'm not sure why its appending "?id=74&name=product-name" after url?


I want to display only "www.mydomain.com/deals/74/product-name.html"


I cant figure out how to fix this problem. I'll appreciate if you can guide me on this.
#301 #appending #query #redirect #string #url

Trending Topics