By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,244 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,244 IT Pros & Developers. It's quick & easy.

how to make non existant pages redirect

P: n/a
Hi
How can I make it so my web hosting server will redirect all hits to non
existant web pages to the main index.html page?
Thanks in advance
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Mike wrote:
How can I make it so my web hosting server will redirect all hits to
non existant web pages to the main index.html page?


That will depend on which web server your site uses. The buzzword you need
is 404.

As to whether doing that is a good thing or not is open to debate. Some
would prefer to inform the visitor that the page does not exist and offer
alternatives.

--
William Tasso
Jul 20 '05 #2

P: n/a
William Tasso wrote:
As to whether doing that is a good thing or not is open to debate.
Some would prefer to inform the visitor that the page does not exist
and offer alternatives.


Not to mention that if you suppress the normal 404 error result,
automated link checkers, search engine indexers, and the like, would
fail to recognize that the page doesn't exist, so lots of wrong
addresses in your site would remain in links and indexes elsewhere.

--
== Dan ==
Dan's Mail Format Site: http://mailformat.dan.info/
Dan's Web Tips: http://webtips.dan.info/
Dan's Domain Site: http://domains.dan.info/
Jul 20 '05 #3

P: n/a
Mike wrote:
How can I make it so my web hosting server will redirect all hits to
non existant web pages to the main index.html page?


If it's an Apache web server, add your own 404. Something like this in
an .htaccess file:

ErrorDocument 404 /file-not-found.html

However don't redirect to the main page. Instead inform the user the
page doesn't exist. You can still offer the usual links or whatever
makes the main index.html the homepage.
Jul 20 '05 #4

P: n/a

"Mike" <mi*****@mindspring.com> wrote in message
news:Ox********************@news4.srv.hcvlny.cv.ne t...
Hi
How can I make it so my web hosting server will redirect all hits to non
existant web pages to the main index.html page?
Thanks in advance


Thanks in advance

OK, I will try it out. But do you think I should leave the old pages there
for the sake of the search engines and modify the code in the old pages to
redirect, or should I just wipe out these very old html files and let the
search engine rebuild?

THanks
Jul 20 '05 #5

P: n/a
Mike wrote:
OK, I will try it out. But do you think I should leave the old pages
there for the sake of the search engines and modify the code in the old
pages to redirect, or should I just wipe out these very old html files and
let the search engine rebuild?


Pages that have *moved* are a completely different animal... If your server
allows it, you should set up redirects that return HTTP status 301 - "Moved
Permanently". Spiders should then take the hint and update their database
appropriately.

If it's Apache, and the server is configured to allow it, you could put the
following in your .htaccess file:

Redirect permanent /old/page.html /new/page.html

If the page has been replaced with a new one that supercedes it, use
'seeother' instead of 'permanent', and apache will generate a "303 - See
Other" status. If the page in question has simply been removed with no
replacement, you could use 'gone' to trigger a "410 - Gone" response.

sherm--
Jul 20 '05 #6

P: n/a
William Tasso wrote:
As to whether doing that is a good thing or not is open to debate. Some
would prefer to inform the visitor that the page does not exist and offer
alternatives.


Indeed: http://www.alistapart.com/articles/perfect404/
--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #7

P: n/a
In article <Ss********************@adelphia.com>,
Sherm Pendley <sp******@dot-app.org> wrote:

If it's Apache, and the server is configured to allow it, you could put the
following in your .htaccess file:

Redirect permanent /old/page.html /new/page.html


The destination must be specified as a complete URL, which might look like

Redirect permanent /old/page.html http://your.site/new/page.html

--
Jon Bell <jt*******@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.