Htaccess

From KOP KB
Revision as of 14:28, 1 August 2014 by ReMaster (talk | contribs) (Created page with "Redirect for SSL <syntaxhighlight lang="apache"> RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [NC,R,L] </syntaxhighlight>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Redirect for SSL

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [NC,R,L]

Two domains pointing at a website one has a different starting point.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^$ http://domain.com/filename.html [L,R=301]