Set redirection on Apache

You can create or modify .htaccess file under your domain mapping root to setup redirection.

To redirect to , add following line to .htaccess:
RedirectMatch 301 ^(.*)$

To redirect to, add following lines to .htaccess:
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$$1 [R=permanent,L]

Redirect to sub folder with .htaccess file
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST}
RewriteCond %{REQUEST_URI} !test/
RewriteRule ^(.*)$ test/$1 [L]

Set https redirect in .htaccess
RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) [R]


- has written 121 posts.

Leave a Reply

You must be logged in to post a comment.