• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Web Dev> Force users from http to https

Apr05
2011
Written by Scott Rowley

Tested and verified working for *nix servers:

Add the following to your .htaccess file in the root of your website:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SERVER_PORT} =80
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI}

I don’t work with IIS so check the following link for information on setting up the redirect on IIS servers:
http://www.sslshopper.com/iis7-redirect-http-to-https.html

Posted in Ubuntu, Web Development, Windows - Tagged apache, follow, force, htaccess, http, https, IIS, nix, options, rewrite, server, symlinks, user
« Ubuntu 10.10 VNC Login Screen
» Web Dev> Password protect apache directory with LDAP & .htaccess

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top