Redirecting a domain to another web page

Let us introduce you to one of the ways of redirecting a domain provided you want it to open another address.

The way to achieve this described in this article is through some changes to the .htaccess configuration file. This is a configuration file of the Apache Web Server through which you can specify different options for a particular website.

NB! Any .htaccess rule will be also valid for the sub-directories of the current directory.

This can be useful in case you have a WordPress installation and using the Redirect .htaccess directive doesn’t do the trick – permalinks not opening the desired content after getting redirected.

cPanel Hosting from WebhostFace

In such case to set up a successful redirection you may try using the mod_rewrite module. Here are the needed rules:

Options +FollowSymLinks -MultiViews
RewriteEngine On # this directive enables mod_rewrite for the current and sub-directories
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?redirectingaddress.com$ [NC]
RewriteRule ^ http://www.targetdomain.com%{REQUEST_URI} [L,NE,P]

Here you’ll have to replace accordingly the redirectingaddress.com and targetdomain.com for your needs.

was this knowledge base article useful to you