Bulgaria 1000

Vesta CP – How to Add domain Redirection

We have receive lot of emails from our customers asking us how to create domain or web redirection using the well known VestaCP. The solution of this is pretty simple if you are familiar with LAMP (Apache), but it is a bit confusing for some new users. So here we did a short & quick Vesta Control Panel guide .

As opposed to WHM/cPanel that provides specific menu to create Domain Redirection so a user will understand what is it and how to use it, VestaCP doesn’t have this feature so users must use of and create Apache .htaccess Redirection manually.

This is how it looks in WHM/CPANEL



Now lets add this in VESTACP

Step 1 – Install VestaCP on your server (if you have not done this yet of course 🙂 ).

Step 2 – Now login to VestaCP admin and add new website. Click on WEB menu then click Add Web Domain.


Step 3 – Type in the domain name you want to forward / redirect then click the green Add button.


once done you’ll see this message:

ADDING DOMAIN -> Domain YOURDOMAIN.COM has been created successfully.

Step 4 – Now launch Putty or Terminal up and login to your server via SSH as root or as user with sudo privilege (or as admin if you configured admin to have SSH access)


Step 5 – Now go to web directory of your newly added website/domain which it should be at this location:

cd /home/user/web/domain.tld/public_html

replace user and domain.tld with your own.

Step 6 – Create new .htaccess file (or edit it if it’s created already):

nano .htaccess

Step 7 – Now put these lines in there:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^ [NC,OR]
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301,NC]

the htaccess redirection above does 301 redirect from example and to and so that old links to carry over. Just replace and above with your own.

Now save changes and exit the editor. In Nano it is Control+O then Control+X.

That’s it. Now everytime anyone opens or will be forwarded to And so if anyone opens or will be redirected to Cool huh?

Leave a Reply

Your email address will not be published.