.htaccess 301 redirect not working

ayhan

New Member
I have a basic CMS in PHP/MySQL where content managers can create pages to the system for public viewing. Each page is then available at an url such as \[code\]http://www.example.com/pages.php?pid=123\[/code\]Now, I want to redirect requests to \[code\]http://www.example.com/pages.php?pid=123\[/code\] to \[code\]http://www.example.com/pages.php?pid=456\[/code\].I've already removed the \[code\]pid=123\[/code\] page from the db but because of the cms code the site still returns a 202 when some one tries to access the page. I thought I could use a 301 redirect in \[code\].htaccess\[/code\] to make the redirect work, i.e.:\[code\]redirect 301 pages.php?pid=123 http://www.example.com/pages.php?pid=456\[/code\]but this doesn't work, Apache still return 202 when trying to fetch the pid=123 page. Also, I've tried using mod_rewrite, but it doesn't work:\[code\]RewriteRule ^pages.php?pid=123$ pages.php?pid=456 [R=301,L]\[/code\]Any ideas what could be wrong and how I can fix the 301 redirect?
 
Top