Forum Moderators: phranque
I was using a content management system (CMS) on a web-site for quite some time. The site was fully crawled by MSN, Yahoo, Google, etc.
I took down the CMS (which happened to be phpWebSite) and have been building the site with more intelligible links. However, I am having a problem getting all of the old links out of the search engine. The reason is, because I am using index.php as my main index page for the site. And anything with index.php?... acts like a "valid" url, even though it's not any more.
For instance, here's a page from the old site:
/index.php?module=article&view=73&MMN_position=62:29
When the search engines try to check that page, they think that the content changed and that the page still exists.
Is there a way, in .htaccess to get links like that to generate true error 404 pages?
I would appreciate your help!
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{QUERY_STRING} ^module=article&view=73&MMN_position=62:29$
RewriteRule ^index\.php$ /some_path_that_does_not_exist.lmth [L]
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{QUERY_STRING} .
RewriteRule ^index\.php$ /some_path_that_does_not_exist.lmth [L]
You could also generate a 410-Gone response:
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{QUERY_STRING} ^module=article&view=73&MMN_position=62:29$
RewriteRule ^index\.php$ - [G]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
DirectoryIndex [b]default.php[/b] index.php index.html index.htm And rename your index.php to default.php.