New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Rewrite 404 page?
Hello Everyone.
It is possible to rewrite the 404 page with a normal page?
What I mean:
I have posted the index.php code into 404.php and works great. The problem are the bots.
They are getting 404 error.
Is there a option to hide this error for the bots? There must be something with headers.
Any idea?
Comments
I'm sorry, but with the amount of help threads you ask for, it makes me believe you're not qualified to run a "advertising platform" - I'll ignore that though for this thread.
He owns MisterHost. That's worse.
IMHO asking for help is not bad on itself.
I don't even understand what he needs. Cloaking?
@Traffic said:
Yeah I own hostgator and ipage also. Is there a problem with it? Help something if you know if not move away.
I have modified it but still wont work. As you can see I have already edited that page.
@deadbeef thank you but still getting broken page error.
No thanks. I'm fine here, NOT helping and NOT moving away.
The forum is not yours.
And BTW, yes, I can help you, but I'm tired of you, so instead of letting you waste my time, I'll waste yours. Deal?
@BuyAds
Ah, I thought the problem was that the bots was registering a 404 code and you didn't want that.
If you want to redirect "non existing" pages to the homepage, try this:
ErrorDocument 404 /index.php
This tells Apache that the "not found" page is "/index.php".
No no.
Am ok with the 404 page. The user should stay there. Just it send to robots an error that page us broken. All o want is to hide/trick this error that is sent.
Not sure I understand, sorry. I'll just explain the process.
When you visit a page, the browser/bot receives 2 things: A status code and content. These are completely separate. You can change both the status cod and the content of each page.
When a visitor OR bot hits a non existing page, it receives a 404 status code and the error page content.
If you want the bots to not know they hit a non-existing page, you must change the status code to 200.
Ok will post the link to check it yourself...
alcatraz - tours (dot)co(dot)uk
when you click a link you will show the modified 404 page. You as user do not see any error (also the page title is modified) only the problem is that the robots gets that error. I want to hide that error.
Ah, I've understood it at last. He wants to get a Google penalty.
Sure thing, I can help you with that:
http://stackoverflow.com/a/18204039
You have to add this code to the header.php file of the template, at the very top of it.
Not working like that. Should I modify wp-blog-header.php with header.php or something else?
I have added the code in header before the php and after it wont work.
You need to add what's right below the "require('../wp-blog-header.php');" line to
header.php
Try both and if neither works, I'll be happy to try it on a sandboxed installation of my own so you can get it as you want.
There is no such line ("require('../wp-blog-header.php');") in header.php
p.s am on wordpress
Here is the head of header.php i have modified many things so maybe i have removed that part.
http://pastebin.com/raw.php?i=juyv3vQF
No - I mean, you have to use the code starting from that line (in StackOverflow)
That means the header.php file must start like this (zero white space or blank lines):
Or
Nothing works
am checking the links here: http://website-link-checker.online-domain-tools.com/
https://www.hurl.it/ is what you need to see the headers
Same 404 Not Found
There's a blank line at the start of every page, also on 404 pages:
Maybe you added by error a blank line while editing 404.php or header.php or any other file, at the start or at the end?
No, the blank line is since i have added your code. Will fix it.
edit: fixed and added your code. Still 404
No. I solved your problem.
Click a post and copy the link and paste to the site you have posted.
Logout or try on another browser and try to click through your posts. There is something really wrong with your relative paths.
You asked to remove the 404 header from 404 errors. I solved that. Now learn HTML and basic URL creation and try again.
outch!!! This one worked but am checking in my site http://website-link-checker.online-domain-tools.com/
in your site when i select to get head am getting error 404.
This worked man! Thank you
You're welcome