Hey, after a little help here please I know its bad for SEO having duplicate pages and after flicking a few pages in to a 'Site:' search on google I've found that Google has indexed both urls so I need a permanent redirect from 'file.php?id=somevalue' to '/folder/somevalue.php' so Google will remove the duplicates from its search engine.
with .htaccess: RewriteEngine On RewriteRule ^file.php?id=(.*) folder/$1.php with PHP: if($_GET['somevalue']){ header("Location: folder/".$_GET['somevalue'].".php"); }
you must write .htaccess for this process. You write code inside of php page. if($_GET['url']){ header("Location: folder/".$_GET['url'].".php"); } and you write httacess rewite module. RewriteEngine On RewriteRule ^file.php?id=(.*) folder/$1.php http://www.tutorialsscripts.com/php-ini-tutorials/php-ini-display_errors.php
That or make an alias directory . Then only the server knows it is one file. EVeryone else sees 2 files from 2 different directories.
If you want search engines to de-list the old one, a rewrite rule without any parameters -- such as that provided by @loop isn't going to do it; the page will load transparently as if it still exists! Completely missing the point Redirect 301 ^file.php?id=(.*) folder/$1.php Code (markup): or RewriteEngine On RewriteRule ^file.php?id=(.*) folder/$1.php [L,R=301] Code (markup): A 301 Permanently moved on the other hand... that should do what you are asking.