homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

How can I redirect error links to a specific page?
Trying to redirect errors

5+ Year Member

Msg#: 3996553 posted 2:34 pm on Sep 27, 2009 (gmt 0)

If someone were to type in something like localhost/WhateverTextHere that's not on my website...How can I redirect that like the below? The examples that I came across are only file to file.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Redirect 301 / [localhost...]



WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 3996553 posted 3:02 pm on Sep 27, 2009 (gmt 0)

Define the target page as your custom 404 error document.

Do not redirect to this target page, as this would confuse search engines -- they would receive a 301 redirect followed by a 200-OK response, and therefore think that the page existed but had moved. And by redirecting *all* non-existent URLs to a single page, you would create "infinite duplicate content" -- not good for your search rankings. (Search our Google forum for "duplicate content" to read previous tales of woe.)

See Apache core, ErrorDocument directive, and read very, very carefully, as a single mistake here could be quite costly to you.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved