Mod rewrite

From Hostek.com Wiki
Revision as of 01:40, 13 August 2013 by Carlb (Talk | contribs)

Jump to: navigation, search

General Information

Mod rewrite is available on our Linux servers and can be used to rewrite or redirect your site to a particular URL.

Redirecting to a Sub Folder

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^$ testdirectory [L]

HTTP to HTTPS

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}