-1

I have a VPS based Centos/cPanel-WHM. I wanna redirect all sites (including all pages & subdomains) on the server to one URL. How can i do this?

Charles
  • 50,943
  • 13
  • 104
  • 142

3 Answers3

0

create .htaccess file in every website DocumentRoot dir which you want to redirect

# This allows you to redirect your entire website to any other domain
Redirect 301 / http://exampledomain-redirect.com/
swserg
  • 692
  • 1
  • 5
  • 18
0
  1. At webserver layer (change the .htaccess), you could issue 301 redirects for any requests to your sites to new URL

OR

  1. you could inject javascript (through your web layer) or your code layout framework OR manually at the head of the page to complete a redirect.

OR

  1. if your domains point to different hosting.. you could upate their NS to point to your new location and do 1 OR 2
Faiz Mohamed Haneef
  • 3,418
  • 4
  • 31
  • 41
0

.htaccess is the best way, Otherwise change the document root for each site.

24x7servermanagement
  • 2,520
  • 1
  • 13
  • 11