Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.

Thread Tools Display Modes
Share |
Old 11-30-2008, 06:40 PM
jeremynet jeremynet is offline
Junior Member
Join Date: 05-03-07
Posts: 1
iTrader: 0 / 0%
how to use htaccess for SSL redirect?


I would like to redirect user from http://domain.com to https://domain.com using htaccess. How to rewrite using htaccess?

But all sub domains remain in http.

Reply With Quote



Old 12-06-2008, 11:02 PM
seosean seosean is offline
Contributing Member
Join Date: 12-06-08
Posts: 107
iTrader: 0 / 0%
I believe this should do the trick but I have not tested it.

PHP Code:
RewriteCond %{HTTP_HOST} ^DomainName.com [NC]
RewriteRule ^(.*)$ https://www.DomainName.com/$1 [L,R=301] 
Look at http://www.askapache.com/htaccess/ap...-examples.html for more ideas on how to do that if my example code doesn't work.
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess 301 redirect modine Coding Forum 14 06-12-2007 11:28 AM
htaccess 301 redirect esiason14 Coding Forum 2 01-31-2007 12:44 PM
.htaccess redirect problem..! Immo Coding Forum 16 08-03-2006 04:02 AM
.htaccess redirect question Pimpen 2010 Coding Forum 4 04-04-2006 10:34 AM
.htaccess redirect to new webspace luchtzak Coding Forum 7 01-25-2004 09:56 AM

V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory

All times are GMT -7. The time now is 10:16 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC