User Tools

Site Tools


internet:hosting:redirect

Web Site Redirection

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 public_html):

vim .htaccess

Entire Site Somewhere Else

# This temporarily redirects your entire website to another domain
Redirect 302 / http://mt-example.com/

Redirect HTTP to HTTPS

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

A permanent version:

<IfModule mod_rewrite.c>
 RewriteEngine On
  RewriteCond %{HTTPS} !on
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
internet/hosting/redirect.txt · Last modified: 2018/11/20 07:38 by gcooper