404 not redirection with repeated php file with separated by slash - http-status-code-404

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

Related

Nextjs application with basePath 404 error with apache reverse proxy

I am using an apache reverse proxy with a custom basePath. The application runs on http://localhost:300/abc, that's what I use in my apache config for both ProxyPass and ProxyPassReverse. My application runs completely fine on the localhost, but it does not work when trying to open the url that the application is supposed to run on. I get a 404 error for the _next folder, which looks like this:
GET https://my_url.com/abc 404 (Not Found)
abc:1 GET https://my_url.com/abc/_next/static/chunks/main-3c1ab6de33e375184ee7.js net::ERR_ABORTED 404 (Not Found)
abc:1 GET https://my_url.com/abc/_next/static/fCdfRYDyffxB73K0CRH3c/_buildManifest.js net::ERR_ABORTED 404 (Not Found)
abc:1 GET https://my_url.com/abc/_next/static/fCdfRYDyffxB73K0CRH3c/_ssgManifest.js net::ERR_ABORTED 404 (Not Found)
When I remove the basePath parameter from my next.config.js, I do not get these errors but that however breaks my api calls.
My abc.conf:
SSLProxyEngine on
ProxyPass /abc http://localhost:3000/abc
ProxyPassReverse /abc http://localhost:3000/abc
[...]
EDIT:
Adding app.use('/_next', express.static('_next')) removes the last 3 errors, but the first one prevails.

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

angularjs html5 hash url

I am using server side google oauth in angular.js,
Suppose my redirect url is localhost:8000/redirect. To remove # in angularjs I am using
$locationProvider.html5Mode(true);
But, when i visit the url I get an error :
Error response
Error code 404.
Message: File not found.
Error code explanation: 404 = Nothing matches the given URI.
However if I type the url manually i.e localhost:8000/#redirect then I get what I expected and then redirects to localhost:8000/redirect
I have also tried to add # from Google app console. But, that is not allowed.
So how to remove hash completely ?

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.

404 redirect with error referrer

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");

Resources