Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,240 Programmers. There are 2,285 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Transfer all visitor to HTTPS regardless of where they go on the domai

 
Reply to this topicStart new topic

Transfer all visitor to HTTPS regardless of where they go on the domai

barcand
post 1 Apr, 2008 - 08:54 AM
Post #1


New D.I.C Head

*
Joined: 1 Apr, 2008
Posts: 1



Hello,

Hopefully someone out there can provide some assistance. We have our site hosted with Network Solutions and a SSL with DigiCert. I need anyone going to DOMAIN.COM to always be redirected to HTTPS://DOMAIN.COM. Below is the code we have but unfortunately it gets caught into a continous loop.

CODE

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ [url=https://www.sharoncu.com/$1]https://www.sharoncu.com/$1[/url] [R=301,L]
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


someone1
post 28 Apr, 2008 - 12:13 PM
Post #2


New D.I.C Head

*
Joined: 28 Apr, 2008
Posts: 6

If you use ASP or PHP, then you can just put a check in the code to verify that the server port is 443 over 80, and if it is 80, force a redirect to port 443.

the rewrite engine can be very tricky to manipulate.

EDIT:

a quick google found me this:
CODE

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


This post has been edited by someone1: 28 Apr, 2008 - 12:15 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 08:13AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month