NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page htaccess - direct all traffic to https://www. ?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
6 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 08-28-2011, 03:47 PM THREAD STARTER               #1 (permalink)
Senior Member
 
NameCharger's Avatar
Join Date: Mar 2007
Posts: 1,695
NameCharger has much to be proud ofNameCharger has much to be proud ofNameCharger has much to be proud ofNameCharger has much to be proud ofNameCharger has much to be proud ofNameCharger has much to be proud ofNameCharger has much to be proud ofNameCharger has much to be proud ofNameCharger has much to be proud of
 


Child Abuse Animal Rescue Autism Child Abuse Protect Our Planet Autism Protect Our Planet

htaccess - direct all traffic to https://www. ?


Hi,

I need to route all domain traffic to https://www.domain.tld

I'm doing this now with htaccess by redirecting traffic on port 80 and it works pretty well but it does not work when https://domain.tld is entered in the browser.

Here's my current htaccess structure:

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain.tld/$1 [L,R=301]

Your input is appreciated!
NameCharger is offline   Reply With Quote
Old 08-28-2011, 09:33 PM   #2 (permalink)
NamePros Member
 
Witchsoft's Avatar
Join Date: Aug 2011
Location: Jakarta
Posts: 62
Witchsoft is an unknown quantity at this point
 




1st solution:

you need to change the https document root path to a different folder than the http folder one.
????: NamePros.com http://www.namepros.com/programming/728739-htaccess-direct-all-traffic-https-www.html
example:
http://www.bla.bala | /public_html
https://www.bla.bla | /public_html/secure
Then place the .htaccess file in /public_html only

Otherwise, you'll got an undless loop

2nd solution:

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

3rd solution:

Using php
PHP Code:
<?
if($_SERVER['SERVER_PORT']==80)
{
  
// redirect it
   
header("location:https://bla.bla");
}
else
{
 
// do nothing
}
?>
Last edited by Witchsoft; 08-28-2011 at 09:48 PM.
Witchsoft is offline   Reply With Quote
Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Real Human Visitor Traffic 100% Unique for only $12.95 - 10% OFF for Name Pros member GrowStats For Sale / Advertising Board 0 08-02-2011 08:51 AM
Thousands of Website Visitors! ~ Starting at $12.95 ~ Real Human Traffic MattBF For Sale / Advertising Board 0 07-28-2011 11:56 AM
Cheapest Daily Traffic, supports popup ads, clicks ads, 6K visitors @0.99/day yohame Advertising & SEO Services 0 07-11-2011 08:36 PM
Guaranteed targeted traffic for your website!! From only $0.001 per visitor!! luke7 Advertising & SEO Services 0 06-26-2011 05:12 PM

 
All times are GMT -7. The time now is 02:49 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger