Results 1 to 3 of 3
  1. #1

    How to redirect to https for subdirectory

    I am trying to redirect a subdirectory to https

    How do I do this?

    I would post an example but I need 5 posts to post an example URL

    I am using Apache/Linux
    Last edited by prettylittlething; 03-16-2011 at 02:49 PM.

  2. #2
    Join Date
    Mar 2009
    Location
    Austin, TX
    Posts
    934
    Here is one way of doing it. Stick following in .htaccess in your sub-directory.
    (off top of my head.)

    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    SysAdmin.xyz
    Having severs with customer data on it without proper monitoring is like having one night stand without using protections - eventually, there will be an 'oh s**t!' moment.

  3. #3
    Thank you!!

    Let me see if I can get around the 5 post rule...

    If I want to redirect http :// example(dot)com/subdirectory to:

    https :// example(dot)com/subdirectory

    I would add this to .htaccess:

    Code:
    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    But exactly what goes in the
    Code:
    {REQUEST_URI}
    I tried doing this in cpanel but it gave me an error..something about a loop

Similar Threads

  1. HTTPS Redirect
    By Andre C in forum Hosting Security and Technology
    Replies: 5
    Last Post: 01-28-2010, 09:28 AM
  2. .htaccess subdirectory redirect help
    By emills01 in forum Hosting Software and Control Panels
    Replies: 6
    Last Post: 10-14-2009, 09:27 PM
  3. Can I redirect to https: ?
    By LeMarque in forum Hosting Security and Technology
    Replies: 5
    Last Post: 10-19-2007, 03:55 PM
  4. Redirect http to https
    By l0ck_up in forum Hosting Security and Technology
    Replies: 8
    Last Post: 11-09-2004, 12:41 AM
  5. how to redirect error 404 page in root and its subdirectory?
    By charts in forum Hosting Security and Technology
    Replies: 2
    Last Post: 10-18-2004, 06:23 PM

Posting Permissions

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