-1

I've very little knowledge in this area - hence the question... I'm looking to do the following:

I currently have a server with a number of websites listed in sites-available and sites-enabled. There is a large list of websites which are no longer in use and I currently have a htaccess in the root of the websites that direct traffic to a new domain like so:

#redirect www.olddomain.ie to www.newdomain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.ie [NC,OR]
RewriteCond %{HTTP_HOST} ^www.newdomain.ie [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301,NC]

Then in the www.newdomain.com website htaccess I have a load of 301 redirects which handle the legacy website pages which no longer exist.

My questions is however if I remove www.olddomain.ie from my sites-available and sites-enabled can I still achieve something similar to the above? Can the above be placed into the httpd.conf file?

Apologies if this is a basic question, like I said I don't have a lot of knowledge in this area.

Thanks and any help is much appreciated.

1 Answers1

1

You will need to have an active vhost serving the domain you want to redirect, even if not in use. It will work absolutely fine in the httpd.conf file, Apache is set to read from all *.conf files.