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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    301 redirect in .htaccess problem

    I am trying to create a 301 redirect code to have all webpages in my website point to the https website area, to access my SSL encryption:

    My .HTACCESS file:

    Options -Indexes
    Redirect 301 / https://www.mydomain.com

    Currently this website is running on a shared server, with a Linux operating system, with an apache server.

    The code that I am using is not successfully traversing to the correct domain name, it mentioned something about an endless loop. Please help

    Just as a side note, when I physically type in my domain name with the https in front it, then it works fine.

    Thanks for any help in advance.

  • #2
    New Coder
    Join Date
    Aug 2007
    Posts
    57
    Thanks
    4
    Thanked 0 Times in 0 Posts
    My first guess would be that because you are essentially redirecting root "/" to root "/" over and over again is why you are getting the endless loop error.

    When you access the page via http is finds the .htaccess and redirects the page to https but then it finds the .htaccess file and redirects again.

    Well that's my best guess... but you say you can access it when you type in the address, which is weird.

    one possible solution is to use different directories for each virtual server. so for your http virtual server use a dir like /var/www/html and for your ssl virtual server use something like /var/www/https

    so that you put your website in https dir and your htaccess in the html dir...

    something like that should fix your problem...

    also, have a look at this thread Rewrite from https to http? HELP!
    Last edited by Loic; 03-24-2010 at 02:25 AM.


  •  

    Posting Permissions

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