Code Snippets and More

Redirect the request for a file or directory is easy as include the following lines into the web root .htaccess Apache file:

RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} ^/file$
RewriteRule ^(.*)$$1 [L,R]

This will redirect every request for the file "file" (for example) with HTTP protocol (any wich the access port different from 443) to another HTTPS secure URL similary to "".

Recent comments

© 2014 Copyright by Keyvan Akbary