Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

htaccess adding query string to 301 redirect

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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:http://www.mydomain.co.uk/newpage.html?c=oldpage

DirectoryIndex index.php index.html index.htm
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} PHPSESSID=.*$
RewriteRule (.*) http://www.mydomain.co.uk/$1? [R=301,L]
RewriteCond %{HTTP_HOST} ^mydomain.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.co.uk/$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 http://www.mydomain.co.uk/newpage.html

ErrorDocument 404 /404.php

thanks for any help
cgbutcher
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Oct 15, 2012 2:12 pm

Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.