473,383 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

how to make non existant pages redirect

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
7 5458
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
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
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

"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Joshua Beall | last post by:
Hi All, I would like to setup my site so that when a page is request that does not exist, transfer is instead passed to a certain page that I specify. For instance, if the user requests...
7
by: PaulThomas | last post by:
I am fighting with XP-Pro and VS.Net trying to allow some of the pages in my application to be accessable by 'all' I am using <authentication mode="Forms" /> and if I Login - everything works...
67
by: Sandy.Pittendrigh | last post by:
Here's a question I don't know the answer to: I have a friend who makes very expensive, hand-made bamboo flyrods. He's widely recognized (in the fishing industry) as one of the 3-5 'best' rod...
5
by: Jon Sequeira | last post by:
Is there a way to redirect from an ASP.NET page to an ASP page without showing the ASP page's URL in the client's browser? This works perfectly with an HTML page, for example: path =...
4
by: | last post by:
I have earlier used an HttpModule that did URL rewrites on the BeginRequest event. Now I am trying to use the same module in a different application on a new and upgraded machine (winxp sp2). ...
3
by: William Sullivan | last post by:
Have a frameset HTML page (parent) with child .aspx pages. When each of the child pages loads, it checks to see if the user is authenticated, and if not, redirects to the login page: ...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: =?Utf-8?B?U2VtU2Vt?= | last post by:
Helloz iam working in a web application for univesity. ihave diffrent kind of roles like: 1-Studetn Affairs 2-Staff imake three sperate master pages for them.: example:
6
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, We have two sites hosted on different servers and we have many pages on domain A which has many links(asp programs) to domain B. My question is if domain B server is in trouble, what is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.