This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
internet:hosting:redirect [2014/07/14 15:48] gcooper created |
internet:hosting:redirect [2018/11/20 07:38] (current) gcooper |
||
---|---|---|---|
Line 2: | Line 2: | ||
Here we redirect a web site to another web site in a very simple way. | Here we redirect a web site to another web site in a very simple way. | ||
+ | |||
+ | :!: A 302 is a temporary redirect. | ||
Edit or create a small text file in the root of your web site (often '' | Edit or create a small text file in the root of your web site (often '' | ||
Line 8: | Line 10: | ||
vim .htaccess | vim .htaccess | ||
</ | </ | ||
+ | |||
+ | ===== Entire Site Somewhere Else ===== | ||
< | < | ||
Line 14: | Line 18: | ||
</ | </ | ||
+ | ===== Redirect HTTP to HTTPS ===== | ||
+ | |||
+ | < | ||
+ | RewriteEngine On | ||
+ | RewriteCond %{HTTPS} off | ||
+ | RewriteRule (.*) https:// | ||
+ | </ | ||
+ | |||
+ | A permanent version: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | | ||
+ | RewriteCond %{HTTPS} !on | ||
+ | RewriteRule ^(.*)$ https:// | ||
+ | </ | ||
+ | </ |