Solved

Redirect my 404 pages to the homepage

Posted on 2010-11-24
4
550 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
  • 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 500 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now