Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Make sure your site (or directory) is SSL encrypted (See related posts)

Need a simple way to make sure all http requests get redirected to https?
This apache config snippet will redirect all requests at or below the specified location to its https equivilant.

<Location "/">
        RewriteEngine on
        Options +FollowSymLinks
        Allow from all
        RewriteCond %{SERVER_PORT} !^443$
        RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</Location>

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts