GeekedOut
GeekedOut

Reputation: 17185

How to make a proper 404 page?

I am about to get rid of a few templates on one of my sites. There are many pages under those templates like

city.php?city_id=1
city.php?city_id=2
city.php?city_id=3
...

What is the right way to tell Google that this page does not exist anymore so that it takes that page out of its index?

Thanks!

Upvotes: 1

Views: 160

Answers (2)

Abhinav Pundi
Abhinav Pundi

Reputation: 11

So you create 2 files:

  • 1st file: a 404 page. Design it however you want.
  • 2nd file: MUST be named .htaccess. Then put the following line of code in the .htaccess file. Assuming your 404 page name is 404.html you would write the following line of code:
ErrorDocument 404 /404.html

Upvotes: 1

Frazell Thomas
Frazell Thomas

Reputation: 6111

If you want Google to delete the pages without carrying forward the references then a simple HTTP 404 will do the trick. If you want Google to forward the references (such as page rank and etc) to the new page then you would be better off using an HTTP 301.

Also See: Google 301 Recommendation.

Upvotes: 5

Related Questions