404 redirect with error referrer - http-status-code-404

I'm looking for a way to have a 404 redirect to the homepage with adding the error to track what's missing.
Something like this:
http://www.example.com/?error=http://www.example.com/notfoundpath
How to di this?
Cheers

Put this in your .htaccess:
ErrorDocument 404 /errors/404.php
Readout the $_REQUEST vars and save them. :-)
Then redirect in the .php file with: header ("Location:/index.php");

Related

404 not redirection with repeated php file with separated by slash

In .htaccess file
ErrorDocument 404 https://dommain.co.in/404.php
If any one put on url like
https://dommain.co.in/about.php/award.php/award.php
Its not redirect 404
page show about.php with unformated url
please resolve the problem

All my requests are returning a 404 error (Not Found)

I'm not sure if its a server issue or something im missing in my routes but all my routes are returning with a 404 error for example
POST https://enigmatic-cliffs-10818.herokuapp.com/api/user/addFavorite/undefined 404 (Not Found)
POST https://enigmatic-cliffs-10818.herokuapp.com/api/user/register 404 (Not Found)
I only have routes including users - login and register, and one to add favourites to their account.
I have come across this error multiple times and i cant seem to change it
here is my github repo would appreciate any help!
https://github.com/MarketingPlus/Tipsy
I am using axios to post my requests aswell
for example here:
register( userData ) {
console.log("------");
console.log(userData);
console.log("------");
return this.axios.post("/api/user/register", userData);
}
Thank you kindly!
try to add the line below on your package.json
"proxy" : "https://enigmatic-cliffs-10818.herokuapp.com/"

How do you make a 404 page?

I thought of making a 404 Page. but it seems hard.. how do i do it?
Here's what I did:
Made .htaccess File
Put: ErrorDocument 404 /page-not-found.html inside of the .htaccess file..
Added css design
Why doesn't it work?
I use glitch as my coding website. Is that the problem?
Is there an alternative way to do this.?
If you want a custom 404 page for an app on Glitch, you'll need to be building a Node/full-stack app and configuring the page in your server-side code.
For example, I've got this simple Express app that sends any non-index route request to a 404 page: https://glitch.com/edit/#!/tranquil-hurricane-friction?path=server.js%3A25%3A0

Apache custom 404 page that returns 404 error

I have a custom 404 error page on my apache (404.php) and it works normally, but if someone or any search engine requests the /404.php page, the server returns 200 (OK), because the page actually exists.
I have already put the Disallow: /404.php on my robots.txt file to prevent Google from indexing that page, but I'd like to return 404, including to this page request.
Is there a way to also return 404 when someone reaches the 404.php directly?
I just whipped this up really quickly:
<?
header("HTTP/1.1 404");
echo "ERROR"; // Put the contents of your 404 page here.
?>
I checked it in Chrome, and this will return a 404 code in the header, and let you write whatever you'd like to the rest of the page. Just put the header function at the beginning of the page.

What is the permalink or URL for a 404 page in WordPress?

I am trying to validate the HTML on my 404 page for a WordPress theme, but obviously, the validator cannot find the page, because it doesn't exist.
http://cambridgeuplighting.com/agsdfachgsd
http://cambridgeuplighting.com/404a234
Or any false link will generate the 404 page, but what's the actual url for this page?
Thanks!
Most systems don't expose a 404 error page with a 200 status code. Tick the Validate error pages option at http://validator.w3.org/#validate_by_uri+with_options instead.
There isn't one, really. Your best bet is:
find the bit in Wordpress which sets the 404 header and comment it out. (I gave it a quick go, but failed)
If you're using firefox, install this addon: https://addons.mozilla.org/en-US/firefox/addon/249 which will validate the page inside the browser. (This seems to be the same kind of thing for Chrome, but I haven't tried it: https://chrome.google.com/extensions/detail/cgndfbhngibokieehnjhbjkkhbfmhojo )
download the pure HTML for the page and upload it.

Resources