views:

17

answers:

1

I recently changed a word in my query string in my url, which causes the query to break, so I wish to redirect the old url to the new one. example:

http://www.lovelakedistrict.com/result/?q=Windermere&result=2

new url

http://www.lovelakedistrict.com/result/?q=Windermere&page=2

What would be the best solution for this, is there anyway do it in php or is it a htaccess rule?

Cheers

+2  A: 

At the top of your page, you can simply use this hotfix:

if(isset($_GET['result']))$_GET['page']=$_GET['result'];
if(isset($_REQUEST['result']))$_REQUEST['page']=$_REQUEST['result'];
Christian Sciberras
This works great thanks, but I am thinking this would cause duplicate pages?
AJFMEDIA
In that case, htaccess with a 301 would be more suitable.
Christian Sciberras