Page 1 of 1

What is the cleanest way to add a list of redirects in Vesta CP ?

Posted: Wed Sep 26, 2018 1:36 pm
by thibaut
Hi,

I moved my site from Wordpress to Mediawiki and I have several 301 redirects to make.

Basically :

Code: Select all

Redirect permanent 12345/old-wordpress-permalink wiki/new_article_title
I also merged another old site in this one so that I also have this type of redirect to make :

Code: Select all

Redirect permanent https://myolddomain.com/12345/old-wordpress-permalink2 https://mynewdomain.com/wiki/new_article_title2
The old domain was in another server and, since I have to close the old sever, I had in the idea to redirect the old domaine on the new sever IP and to add the old domain as an alias of the new domain in Vesta.

What would be the cleanest way to implement these 3 points in VestaCP in your opinion ?

Thanks

Re: What is the cleanest way to add a list of redirects in Vesta CP ?

Posted: Mon Oct 01, 2018 10:57 am
by demian
use nginx rewrite

add an additional file /home/user/conf/nginx.you_site.conf

Code: Select all

location ~ /12345/old-wordpress-permalink2 {rewrite ^ https://mynewdomain.com/wiki/new_article_title2 last;}