I am using ErrorDocument 404 /404.php for the custom 404 page. this will display while someone type pages not there. But While someone types https://mywebsite.in/?df or https://mywebsite.in/abc.php/?ab same page appears and is indexed in google as well. what I will do?
Asked
Active
Viewed 43 times
1
-
1Please confirm through your browsers inspector tools that the HTTP status code is in fact 404 – Chris Haas Dec 07 '21 at 04:37
-
Checked Status is : 200 – Dip Desai Dec 07 '21 at 04:53
-
In your htaccess, do you have a central router to a file such as index.php? – Chris Haas Dec 07 '21 at 04:56
-
`abc.php` and `index.php` exist. Check the provided parameters and throw header(s) as expected. – user3783243 Dec 07 '21 at 05:07
-
@ChrisHaas No i do not have central router to a file in htaccess – Dip Desai Dec 07 '21 at 07:39
-
1The second one, `/abc.php/?ab`, you can prevent from "working" via the [`AcceptPathInfo`](https://httpd.apache.org/docs/2.4/mod/core.html#acceptpathinfo) directive. The first one you will have to handle explicitly - the server does not know, which parameter names (and which values, if you want to check those as well) are valid. So you would either have to check that via mod_rewrite, or handle it directly from within your PHP scripts. – CBroe Dec 07 '21 at 08:16
-
Are you using query strings or path-info (2nd example) on any of your legitimate URLs? – MrWhite Dec 07 '21 at 12:12