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.


Closed Thread
 
Thread Tools Display Modes
Share |
  #1  
Old 10-30-2016, 10:38 AM
Arcade's Avatar
Arcade Arcade is offline
Contributing Member
 
Join Date: 10-28-16
Location: Bronx, NY
Posts: 75
iTrader: 0 / 0%
force https on one page only?

Hello,

Can someone tell me the code for htaccess to force one page to use https?

I have done a lot of searchers on google but it shows me what I think is old code from 2007, 2010.

I have 3 pages that I only want to add https to /register, /login, /contact us

Nothing happens when I add the code that I find.
 

Advertisement

Advertisement

  #2  
Old 10-30-2016, 10:52 AM
Arcade's Avatar
Arcade Arcade is offline
Contributing Member
 
Join Date: 10-28-16
Location: Bronx, NY
Posts: 75
iTrader: 0 / 0%
This code works but it enables HTTPS to the whole website.

Code:
RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/register [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301] RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/login [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301] RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/contact-us [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
 
  #3  
Old 10-30-2016, 01:07 PM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,016
iTrader: 4 / 100%
Guys you might be able to jury rig something that looks like it is but you don't have a real https site unless you follow the rules:

Quote:
Step 1: Host with a dedicated IP address. In order to provide the best security, SSL certificates require your website to have its own dedicated IP address. ...
Step 2: Buy a Certificate. ...
Step 3: Activate the certificate. ...
Step 4: Install the certificate. ...
Step 5: Update your site to use HTTPS.

https://support.google.com/webmaster.../6073543?hl=en
 
  #4  
Old 10-30-2016, 01:55 PM
Arcade's Avatar
Arcade Arcade is offline
Contributing Member
 
Join Date: 10-28-16
Location: Bronx, NY
Posts: 75
iTrader: 0 / 0%
Thank you for the reply Scriptman,

The hosting package that I got from hostgator comes with a dedicated ip and SSL certificate. In the other website that I was using before I had SSL enabled for the full site but it was causing problems with the links coming into the site. Now that I have this new website I don't want the samething to happen is why I only want ssl enabled in 3 pages.

Thank you for the link.
 
  #5  
Old 10-30-2016, 02:34 PM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,016
iTrader: 4 / 100%
After reading this page I think maybe a subdomain that contains the secure pages might be the answer. Since I hate to link to other forums even when I am a member there I am not going to post a live link. webhostingtalk.com/showthread.php?t=925938

This is the search link where I found that page: https://www.google.com/search?q=only...utf-8&oe=utf-8
 
  #6  
Old 10-30-2016, 02:51 PM
Arcade's Avatar
Arcade Arcade is offline
Contributing Member
 
Join Date: 10-28-16
Location: Bronx, NY
Posts: 75
iTrader: 0 / 0%
Thanks you again Scriptman,

I understand about linking to other forums.

It's going to take me hours but I'll get it working.
 
  #7  
Old 11-14-2016, 07:20 PM
themeply themeply is offline
Junior Member
 
Join Date: 11-14-16
Posts: 23
iTrader: 0 / 0%
Code:
RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^single\.html$ Xttps.example.com/single.html[L,R=301]
replace Xttps with https:// since the forum won't allow me to post links yet
 
  #8  
Old 11-14-2016, 07:33 PM
Arcade's Avatar
Arcade Arcade is offline
Contributing Member
 
Join Date: 10-28-16
Location: Bronx, NY
Posts: 75
iTrader: 0 / 0%
Thank you for the reply themeply,

I have been using that same code for the past week now.

It's working good.
 
  #9  
Old 11-14-2016, 08:19 PM
themeply themeply is offline
Junior Member
 
Join Date: 11-14-16
Posts: 23
iTrader: 0 / 0%
Glad you got it working.
 
Go Back   Webmaster Forum > Web Development > Coding Forum

Closed Thread


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
WordPress force HTTPS and change all HTTP links to HTTPS? yangyang Blogging Forum 1 04-25-2015 05:47 PM
Difference between Http page and Https pages? RosieGlover SEO Forum 24 12-07-2014 03:52 PM
A Lot Of First-Page Google Results Are Using HTTPS snakeair Google Forum 8 10-20-2014 09:27 AM
PHP - how to get headers of an HTTPS page? datrader Coding Forum 11 07-09-2012 07:54 AM


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


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