Solved

Change the url of a page to HTTP from HTTPS

Posted on 2010-11-08
7
745 Views
Last Modified: 2012-06-27
I need to find a solution to a problem i am having with certain pages on my website.  At the moment i have an SSL certificate for my Drupal site, and a rewrite rule forcing every page to be HTTPS.

The problem i have is for certain pages
https://www.drughelpdesk.com/drug-counselor-video-blog
https://www.drughelpdesk.com/Drug-Counselor-Video-Blog/Restoring-Trust-After-Drug-Addiction

I get a security warning in Internet Explorer "Only Secure Content is Displayed .... Show all content" and people need to click "show all content" to beable to view the video in IE.  

What i need somebody to do for me is to provide me with the Apache code which will change the above 2 pages to plain HTTP: while keeping the rest of the site secure HTTPS.   htaccess.txt
0
Comment
Question by:Jon Imms
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 26

Expert Comment

by:arober11
ID: 34088377
Simple add the following rule:

RewriteCond %{HTTPS}             on
RewriteCond %{REQUEST_URI} (drug-counselor-video-blog|Restoring-Trust-After-Drug-Addiction)
RewriteRule  .*                          http://www.drughelpdesk.com%{REQUEST_URI}  [L]

and change this rule:

RewriteCond %{SERVER_PORT} 80
RewriteRule  .*                          https://www.drughelpdesk.com%{REQUEST_URI}  [L]

to this:

RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !(drug-counselor-video-blog|Restoring-Trust-After-Drug-Addiction)
RewriteRule  .*                          https://www.drughelpdesk.com%{REQUEST_URI}  [L]


See: http://www.experts-exchange.com/A_4043.html 
0
 
LVL 10

Expert Comment

by:honestman31
ID: 34088391
I'm not sure if Drupal  will let u add PHP code or not but if it does  is then
Add this code to the php pages  you want to redirect



<?php 
if  ( $_SERVER['HTTPS'] ) 
        { 
                $host = $_SERVER['HTTP_HOST']; 
                $request_uri = $_SERVER['REQUEST_URI']; 
                $good_url = "http://" . $host . $request_uri; 


                header( "HTTP/1.1 301 Moved Permanently" ); 
                header( "Location: $good_url" ); 
                exit; 
        } 
?>

Open in new window

0
 
LVL 26

Expert Comment

by:arober11
ID: 34088406
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:Jon Imms
ID: 34088487
Sage::

I followed your solution, and now my whole site i get

This web page has a redirect loop.

The web page at https://www.drughelpdesk.com/index.php?q=about-us has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

What do i do ?
0
 
LVL 26

Expert Comment

by:arober11
ID: 34089415
Quickest solution would be to add "index.php" to the exclusion list in just the HTTP->HTTPS rule e.g.


RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !(drug-counselor-video-blog|Restoring-Trust-After-Drug-Addiction|index\.php)
RewriteRule  .*                          https://www.drughelpdesk.com%{REQUEST_URI}  [L]


But you should possibly give some thought to what needs to be served via HTTPS rather than HTTP, guessing you only need to protect the login / registration pages, rather than the whole site.
0
 

Accepted Solution

by:
Jon Imms earned 0 total points
ID: 34098569
I found a solution to this,  which did not involve apache code.  I found one of the php files in the vimeo module of my drupal installation, and change https://ww.vimeo.com/video   to https://www.secure.vimeo.com/video   and that has solved the problem.  Sorry for wasting peoples times.

Regards.
0
 

Author Closing Comment

by:Jon Imms
ID: 34130299
The answer was not regarding apache eventually, it was actually changing the link in vimeo.inc  in my drupal modual.  

changing www.vimeo.com/vidoevariable to www.secure.vimeo.com/vidoevariable   solves the problem.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question