Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
September 22, 2014, 08:21:32 PM

Pages: [1]   Go Down
  Print  
Author Topic: How do error pages work here?  (Read 3223 times)
norm_256
Pong! (the videogame) Master
*****
Offline Offline

Posts: 25


WWW
« on: December 17, 2006, 12:42:43 PM »

How are the error pages constructed through cpanel served?

For example, are they url-rewrites?

When the 404 comes up the wrong url still shows up.

The issue comes up because we were hacked by a porn site that managed to add several pages to our site, then managed to get the pages into the top 10 within a week. We deleted the pages, so we're not at the top of the search rankings anymore. If the 404 does a url rewrite, then the pages exist again, and we might climb the rankings again. Despite my admiration for their SEO, I can't really have my site serving porn or be ranking for porn terms. BUT, with all that traffic coming I'd still like to have some monetization.

The other part of it is that if it is a rewrite, then the pages aren't "error pages" and we can (in theory) put ads like adsense on them.

Details and comments are welcome.

The problem is, if the "new/hacked" pages are recognized as existing then
Logged
SteveW
Master Jedi
*****
Offline Offline

Posts: 1394


WWW
« Reply #1 on: December 17, 2006, 11:00:46 PM »

Despite my admiration for their SEO,...
Haha That's unusually generous and tolerant!

Quote
When the 404 comes up the wrong url still shows up.
Yes, in the address bar, I see what you mean.

Quote
The other part of it is that if it is a rewrite, then the pages aren't "error pages" and we can (in theory) put ads like adsense on them.
I'd strongly advise against that.  By the duck test, "If it looks like an error page and quacks like an error page..." Based on posts in other forums, AdSense is pretty strict, and once you're banned, you might not have much of a shot at getting back in unless your site is big enough that it's worth their time to negotiate with you.  I think they also have a requirement that AdSense can only go on content pages, so unless you put articles on your error pages, they'd still fail that test. Splitting hairs with the terminology isn't worth the risk because you'll never get the opportunity to argue your point with them. 

One thing you could do, as long as the pages the hackers created didn't have obvious porn page names, is create your own pages of those same names, with whatever content you want to put on them. Not sure I'd try that myself, but it's a devilish idea. Evil or Very Mad

Quote
How are the error pages constructed through cpanel served?
For example, are they url-rewrites?
I'm sorry I don't know the definitive answer to this question. I believe the error pages are served as .shtml, with the name of the originally requested page inserted into the text. Come to think of it, I think the important concept is that the result CODE of the returned packet is 404. Regardless of what text is on the page, that code is a formal HTTP notification that the page does not exist, and is an error code. So I guess that really does answer the question. It is an error page regardless of how it's rendered. The Apache documentation might have more info. http://httpd.apache.org/docs/1.3/.
« Last Edit: December 17, 2006, 11:06:52 PM by SteveW » Logged





Mt. Shasta
photo gallery.


Don't forget Lunarpages 24/7/365 support documentation:
Flash Tutorials, Knowledge Base FAQ Articles, cPanel Manual, Glossary/Dictionary, Support Tickets,
and
Forum Search.

norm_256
Pong! (the videogame) Master
*****
Offline Offline

Posts: 25


WWW
« Reply #2 on: December 18, 2006, 05:39:53 AM »

Well, you basically confirmed everything I was thinking. I was just hoping someone would have a clever solution.

I've thought about putting content on the hacked pages, but I don't want those pages to reappear in the serps. Besides, I'm not sure what kind of medical content I could write for "zoo.html". Actually, I don't even want to contemplate it.

Logged
afalubi
Newbie
*
Offline Offline

Posts: 4


« Reply #3 on: December 18, 2006, 08:06:15 AM »

I did some testing and found the following:

Using the lunarpages cpanel you can create a custom 404 page that is a .shtml file. Users who don't have much developer experience should probably go this route.

Alternatively, you can add a line to the .htaccess file to use a custom 404 file that is an html, php, etc. Just add a line similar to the following:

Code:
ErrorDocument 404 /error_page.html

or

Code:
ErrorDocument 404 /error_page.php

The returned page still uses the bad/original url, and still has the 404 code in the html header, so will still show up as an error page, even though you've customized it.

Logged
TranzNDance
Princess of Naboo
Berserker Poster
*****
Offline Offline

Posts: 11619



WWW
« Reply #4 on: December 18, 2006, 08:51:09 AM »

Sorry to see you got hacked, norm_256. Do you know how it happened? Were you able to plug the hole?
Logged

Grr..!! Luff Ya Grr..!! Luff Ya Grr..!! Luff Ya
mikexx2020
Spacescooter Operator
*****
Offline Offline

Posts: 32


« Reply #5 on: December 19, 2006, 02:48:16 PM »

In your htaccess access use
ErrorDocument 404 http://www.yoursite.com/error_page.php
instead of
ErrorDocument 404 /error_page.php
Logged
lexhair
Galactic Royalty
*****
Offline Offline

Posts: 427


« Reply #6 on: January 07, 2007, 10:35:07 AM »

Does this have to go in every .htaccess file or just in the webroot?
Logged
SteveW
Master Jedi
*****
Offline Offline

Posts: 1394


WWW
« Reply #7 on: January 07, 2007, 11:10:47 PM »

Does this have to go in every .htaccess file or just in the webroot?
.htaccess commands generally apply to the folder they're in and all folders beneath that point unless they're overridden by commands in lower-level .htaccess files, so you should be able to put it only in your public_html/.htaccess file. That's the general rule, anyway; I have no experience with the ErrorDocument command.

----------

From earlier in this thread:

Quote
One thing you could do, as long as the pages the hackers created didn't have obvious porn page names, is create your own pages of those same names, with whatever content you want to put on them.

This wasn't a good idea because it acknowledges the pages as belonging to you. That is, as long as those page names exist, they'll remain in search engine caches. If someone runs across "your" cached porn pages in a search engine, they'll wonder why your site used to have pages of that type. Much better to disavow ownership of the pages by deleting them as norm_256 apparently did. When the search engines get 404 errors, they'll gradually purge the cached pages.
« Last Edit: January 07, 2007, 11:14:06 PM by SteveW » Logged





Mt. Shasta
photo gallery.


Don't forget Lunarpages 24/7/365 support documentation:
Flash Tutorials, Knowledge Base FAQ Articles, cPanel Manual, Glossary/Dictionary, Support Tickets,
and
Forum Search.

Pages: [1]   Go Up
  Print  
 
Jump to: