Question
How do I redirect my dedicated IP address to my domain name?
Answer
This requires a custom Apache included to be added to the following location:
/etc/apache2/conf.d/includes/pre_virtualhost_global.conf
The following example can be used, replacing the IP address, username, domain name, and email address as necessary:
<VirtualHost 1.1.1.1:80>
ServerName domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/username/public_html
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^1\.1\.1\.1$
RewriteRule ^/(.*)$ http://domain.com/$1 [L,R=301]
</IfModule>
</VirtualHost>
Once added Apache needs to be rebuilt and restarted:
/scripts/rebuildhttpdconf; /scripts/restartsrv_httpd