Jon Imms
asked on
Change the url of a page to HTTP from HTTPS
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.c om/drug-co unselor-vi deo-blog
https://www.drughelpdesk.c om/Drug-Co unselor-Vi deo-Blog/R estoring-T rust-After -Drug-Addi ction
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
The problem i have is for certain pages
https://www.drughelpdesk.c
https://www.drughelpdesk.c
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
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
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;
}
?>
ASKER
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 ?
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 ?
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-blo g|Restorin g-Trust-Af ter-Drug-A ddiction|i ndex\.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.
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !(drug-counselor-video-blo
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
changing www.vimeo.com/vidoevariable to www.secure.vimeo.com/vidoevariable solves the problem.
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} (drug-counselor-video-blog
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-blo
RewriteRule .* https://www.drughelpdesk.com%{REQUEST_URI} [L]
See: https://www.experts-exchange.com/A_4043.html