apache - htaccess HTTPS only no redirect -


i want block port 80 (http) , allow https requests. have found many examples of how redirect http https prefer display error instead. cannot block port 80 in config file hosting provider not allow me modify these files. if possible, how can achieve same results htaccess.

the reason me wanting on api.domain.com added security after reading article.

quote article...

aside abandoning http basic altogether there easy fix. close port 80 on api host. stops connection being made dead in tracks, preventing credentials being sent in clear

try:

rewriteengine on rewritecond %{https} off rewritecond %{request_uri} !/error\.php rewriterule ^ http://%{http_host}/error.php [l,r] 

or

rewriteengine on rewritecond %{https} off rewriterule ^ - [l,f] 

Comments

Popular posts from this blog

command line - Use qwinsta in PowerShell ISE -

java - Incorrect order of records in M-M relationship in hibernate -

Python website log in: BIG-IP can not find session information in the request -