Forum Moderators: phranque
Im archiving a dot com domain to a dot net. But the thing is that many people have bookmarked pages for the dot com domain.
so i want an htacess which does this:
if the url is not found (404) then redirect to the same url but on the dot net domain eg:
if
http://example.com/showthis.php?type=1&id=35603 = 404 error
then redirect to
http://example.net/showthis.php?type=1&id=35603
can anyone tell me what the htacess for this should be?
thanks
Mod_rewrite cannot know that the database entry for "type=1&id=35603" does not exist, because mod_rewrite has no knowledge of your CMS or database.
If the question is "How do I detect if the file corresponding to the URL-path '/showthis.php' does not exist?", then the answer is to use a RewriteCond checking %{REQUEST_FILENAME} and the "-f" operator, as described in the mod_rewrite documentation.
Please see our Apache Forum Charter [webmasterworld.com] for links to useful information and tips for getting the most from this forum.
Jim
[edited by: jdMorgan at 5:57 pm (utc) on Feb. 14, 2009]