Solved Change domain name

Running FreeBSD 9.3

I want to change the domain name of my installation from www.abc.co.uk to www.xyz.co.uk. I couldn't really find out what files need to be changed so decided to look for myself. So far I have found these but not being fully savvy with FreeBSD I may have missed some files and / or scripts to run ...

etc/rc.conf
etc/hosts
etc/resolv.conf
usr/local/etc/apache22/httpd.conf
usr/local/etc/apache22/extra/httpd-vhosts.conf *
etc/mail/aliases

* The reason for the change is the need to create 2 subdomains of www.xyz.co.uk.

Any help would be much appreciated.
 
Those should be all you need to change.
Unfortunately something has gone wrong ...

The primary domain name was www.wgtls.co.uk. It has now been changed to www.golfladders.co.uk by changing the above files.

If I browse to www.golfladders.co.uk it is redirecting to one of the sub domains wgtls.golfladders.co.uk but I have not set any redirects.

Both sub domains are working fine thankfully (pgls.golfladders.co.uk and wgtls.golfladders.co.uk)

If it's any help this is the content of my httpd-vhosts.conf:
Code:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#<VirtualHost *>
#  ServerName wgtls.co.uk
#  ServerAlias wgtls.co.uk www.wgtls.co.uk
#  RewriteEngine on RewriteRule ^/(.*) http://www.wgtls.golfladders.co.uk/$1 [L,R=301]
#</VirtualHost>

<VirtualHost *:80>
  DocumentRoot "/websites/wgtls"
  ServerName wgtls.golfladders.co.uk:80
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot "/websites/pgls"
  ServerName pgls.golfladders.co.uk:80
</VirtualHost>
In there you can see the attempt I made to redirect any www.wgtls.co.uk domain.

So there are 2 things wrong that I can see:
1. www.golfladders.co.uk redirects to wgtls.golfladders.co.uk
2. Anyone trying to use www.wgtls.co.uk/xxx I cannot get a domain rewrite working for.

I just hope I've not screwed something up. :(
 
Both the domains are pointing at my server correctly, but all this has gone wrong since I tried to change the domain name from www.wgtls.co.uk (old) to www.golfladders.co.uk (new)

However I have now sorted the rewrite for anyone still using the old domain by adding the following to httpd-vhost.conf file ...
Code:
<VirtualHost *:80>
  ServerName www.wgtls.co.uk
  ServerAlias wgtls.co.uk
  RewriteEngine on
  RewriteCond %{HTTP_HOST} !^wgtls.golfladders.co.uk$
  RewriteRule (.*) http://wgtls.golfladders.co.uk$1 [R=301,L]
</VirtualHost>
What I can't understand is why www.golfladders.co.uk redirects to wgtls.golfladders.co.uk when I have no redirect in place.
 
Back
Top