Throw 404 when requesting file unless HTTPS

2019-08-18 05:56发布

问题:

I need to create a condition in my .htaccess file that will give a 404 when a user requests a file over HTTP, but not when they request it over HTTPS. I have about 15 files in the same directory that this needs to happen with (but not the others).

回答1:

Use Redirect with a status of 404 on those locations.