?
Solved

Redirect my 404 pages to the homepage

Posted on 2010-11-24
4
Medium Priority
?
570 Views
Last Modified: 2012-05-10
I have a site with many pages which have external links pointing to them.

I've renamed many pages on my site.


So now lots of those external links produce 404 pages on my site which is bad.


Question:
How can I (.htaccess?) redirect (301) all of those 404 pages to the homepage, so if a link points to http://mydomain.com/invalid_page.html

and that page doesn't exist, I want the user when clicking on that link to get to: http://mydomain.com


Thanks
0
Comment
Question by:xcdev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:PorterGraphics
ID: 34208203
You should be able to set up a custom 404 page through your host provider. Select your homepage as the page that is displayed when a 404 error is encountered.
0
 
LVL 3

Expert Comment

by:KevinTHayashi
ID: 34208243
What is the webserver platform?  IIS, Apache, something else???

Do you have access to the webserver to make changes?  PorterGraphics is absolutely right on custom 404 error pages and something that is done all of the time.
0
 

Author Comment

by:xcdev
ID: 34208330
It is an apache server

I have access to it.


I want it to be a redirect so I won't lose the SEO, I don't want google to think I have abd page - a 404
0
 
LVL 3

Accepted Solution

by:
KevinTHayashi earned 2000 total points
ID: 34208395
In your .htaccess file add a line for:

ErrorDocument 404 /index.html

More info here:
http://bignosebird.com/apache/a7.shtml

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question