Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: SSL Mod Rewrite

  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SSL Mod Rewrite

    Hey,

    I would like to have selected pages show under SSL. So if a user was viewing:

    http://MYDOMAIN.com/signup.php

    I want it to automatically redirect to

    https://MYDOMAIN.com/signup.php

    Can someone tell me how to do this with .htaccess?

    Thanks in advance.

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    376
    Thanks
    0
    Thanked 24 Times in 24 Posts
    This should work, but i don't have SSL to test. Put it in a .htaccess file in your root directory:
    Code:
    RewriteEngine On
    
    RewriteCond %{SERVER_PORT} !^443$
    # the pages are inside the "()" seperated by "|"s
    # if it's in a subdirectory, put the whole path (no starting "/")
    RewriteRule ^(signup\.php|otherpage\.php|dir/some/thirdpage\.php)$ https://%{HTTP_HOST}%{REQUEST_URI} [QSA,R=301,L]
    I'm assuming your SSL runs on the default port (443).

  • #3
    New to the CF scene
    Join Date
    Apr 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your code works like a charm schleppel, really appreciate you taking your time to help me.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •