Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-16-2010, 11:12 PM   PM User | #1
CenterStage
New to the CF scene

 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
CenterStage is an unknown quantity at this point
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.
CenterStage is offline   Reply With Quote
Old 03-24-2010, 01:20 AM   PM User | #2
Loic
New Coder

 
Join Date: Aug 2007
Posts: 57
Thanks: 4
Thanked 0 Times in 0 Posts
Loic is an unknown quantity at this point
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 http://codingforums.com/showthread.php?t=191665

Last edited by Loic; 03-24-2010 at 01:25 AM..
Loic is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:07 AM.


Advertisement
Log in to turn off these ads.