Scripts

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  • 1st:

    <?php

    if (!(isset($_SERVER[‘HTTPS’]) && ($_SERVER[‘HTTPS’] == ‘on’ ||
    $_SERVER[‘HTTPS’] == 1) ||
    isset($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) &&
    $_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’))
    {
    $redirect = ‘https://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’];
    header(‘HTTP/1.1 301 Moved Permanently’);
    header(‘Location: ‘ . $redirect);
    exit();
    }
    ?>

 

  • 2nd:

< ?php

function redirectTohttps() {

if($_SERVER[‘HTTPS’]!=”on”) {

$redirect= “https://”.$_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’];

header(“Location:$redirect”); } }

?>

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”HTTP to HTTPS redirect” stopProcessing=”true”>
<match url=”(.*)” />
<conditions>
<add input=”{HTTPS}” pattern=”off” ignoreCase=”true” />
</conditions>
<action type=”Redirect” redirectType=”Permanent” url=”https://{HTTP_HOST}/{R:1}” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

  • If the script doesn’t work, try following in IIS:

since url rewrite module is not working for some reason, I’ve set up the redirect this way:

In SSL Settings -> require SSL

In Error Pages -> On 403.4 error -> Redirect to the HTTPS site

In Error Pages -> Edit Features Settings… -> Set Detailed errors for local requests and custom error pages for remote request

 

Redirect 301 / http://brandywineimaging.com

 

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

 

 

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.
mod_gzip_item_exclude mime ^image/.
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

 

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
</IfModule>

 

upload_max_filesize = 200M
post_max_size = 200M
memory_limit = 200M

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

rsync -avz sagecontrols.sql [email protected]:/home/29/06/7210629/web/


scp bebw.ca.tar.gz [email protected] -p 21:/webspace/httpdocs
scp bebw.ca.tar.gz [email protected]:/webspace/httpdocs

 

Scroll to top