htaccess adding query string to 301 redirect

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Mon Oct 15, 2012 2:12 pm

htaccess adding query string to 301 redirect

Postby cgbutcher » Mon Oct 15, 2012 2:28 pm

can sombody help me out with this, im trying to re direct a page using htaccess file but it keeps adding ?c=oldpage on to the end of the new url example:

DirectoryIndex index.php index.html index.htm
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)$1? [R=301,L]
RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]
RewriteCond %{THE_REQUEST} /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
RewriteEngine on
RewriteRule ^product/(.*).html$ product.php?p=$1 [L]
RewriteRule ^(.*)\.html$ category.php?c=$1 [L,NC]

Redirect 301 /oldpage.html

ErrorDocument 404 /404.php

thanks for any help

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 15 guests