0

I want to accept connections on my Raspberry Pi Apache server. I've found that it works great with "http://raspberrypi.local" but when I type in "https://raspberrypi.local" it fails (not available message).

If I wanted to force HTTP (from HTTPS requests) to the file index.php what would I need to change? Could this be done in the .htaccess file? Or do I need to also make sure I'm listening on port 443, as well as 80?

closed as off-topic by goldilocks Mar 16 '16 at 12:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – goldilocks
If this question can be reworded to fit the rules in the help center, please edit the question.

2

You would have to have something (i.e. Apache) listening on port 443, since every browser will use that port by default for HTTPS. And since you'll have to set a certificate in order to accept connections in the first place, you probably wouldn't gain much by redirecting HTTPS connections to HTTP after all the SSL handshaking (and self-signed certificate warning in the browser) is out of the way.

You can do this kind of redirect via .htaccess, though, and redirecting HTTP to HTTPS is pretty common. I have a general-purpose file-upload form on my site, and this rule forces it to HTTPS. This could be easily adapted to do the reverse.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?upload.php https://%{SERVER_NAME}/upload.php [R,L]

Not the answer you're looking for? Browse other questions tagged or ask your own question.