ssl redirect
Posted: Thu Oct 04, 2018 4:51 pm
I have an apache ssl redirect (http to https) and I can't get the site to index. keep getting no host error.
Code: Select all
#
# robots.txt
#
# This file is to prevent the crawling and indexing of certain parts
# of your site by web crawlers and spiders run by sites like Yahoo!
# and Google. By telling these "robots" where not to go on your site,
# you save bandwidth and server resources.
#
# This file will be ignored unless it is at the root of your host:
# Used: http://example.com/robots.txt
# Ignored: http://example.com/site/robots.txt
#
# For more information about the robots.txt standard, see:
# http://www.robotstxt.org/robotstxt.html
User-agent: *
# CSS, JS, Images
Allow: /core/*.css$
Allow: /core/*.css?
Allow: /core/*.js$
Allow: /core/*.js?
Allow: /core/*.gif
Allow: /core/*.jpg
Allow: /core/*.jpeg
Allow: /core/*.png
Allow: /core/*.svg
Allow: /profiles/*.css$
Allow: /profiles/*.css?
Allow: /profiles/*.js$
Allow: /profiles/*.js?
Allow: /profiles/*.gif
Allow: /profiles/*.jpg
Allow: /profiles/*.jpeg
Allow: /profiles/*.png
Allow: /profiles/*.svg
# Directories
Disallow: /core/
Disallow: /profiles/
# Files
Disallow: /README.txt
Disallow: /web.config
# Paths (clean URLs)
Disallow: /admin/
Disallow: /comment/reply/
Disallow: /filter/tips/
Disallow: /node/add/
Disallow: /search/
Disallow: /user/register/
Disallow: /user/password/
Disallow: /user/login/
Disallow: /user/logout/
# Paths (no clean URLs)
Disallow: /index.php/admin/
Disallow: /index.php/comment/reply/
Disallow: /index.php/filter/tips/
Disallow: /index.php/node/add/
Disallow: /index.php/search/
Disallow: /index.php/user/password/
Disallow: /index.php/user/register/
Disallow: /index.php/user/login/
Disallow: /index.php/user/logout/
This script allows me to test various https (ssl) sites. For each run, I uncommented out a single line with a $target.<?php
//$target = "ssl://tpwd.texas.gov"; // URL after the 'ssl://' can vary, 'ssl://' must remain
//$target = "ssl://www.parks.ca.gov";
//$target = "ssl://southcarolinaparks.com";
//$target = "ssl://blog.worldspaceflight.com";
//$target = "ssl://www.worldspaceflight.com";
$target = "ssl://www.okanoganpud.org";
$port = 443; // SSL port is 443, normal port is 80
$fsocket_timeout = 30;
$fp = fsockopen($target, $port, $errno, $errstr, $fsocket_timeout);
if (!$fp) {
echo "FAIL<br>";
die($errno.", ".$errstr.", ".$s);
} else {
echo $errno."<br>".$errstr."<br>SUCCESS";
}
fclose($fp);
?>
Rewrite Engine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.okanoganpud.org/$1 [R=301,L}
Code: Select all
RewriteEngine on
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://www.okanoganpud.org/$1 [R=301,L}
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^www\.okanoganpud\.org*
RewriteRule ^(.*)$ https://www.okanoganpud.org/ [L,R=301]
#Drupal Clean URLs
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME !-d
RewriteRule ^(.*)$ index.php?Q=$1 [L,QSA]