We have a customer that posts a weather cam on their site. Their account used to be on a server that we recently decommissioned to upgrade to CentOS7/CloudLinux. Prior to the upgrade, we moved all of the accounts to another server. We have since discovered that for the past 10 or 12 years, the customer posted the weathercam link to several visitor/vacation and other sites. No issue with that; however, they used the IP address of the old server rather than their domain name:
123.123.123.123/~customerID/weathercam.jpg
This results in the 'Sorry' page and a link to our system administrator email, and the subsequent email from some anonymous person who wants to see the weather.
So, how do we redirect the IP address to the customer's domain name? Would adding a redirect to /etc/apache2/conf.d/includes/pre_virtualhost_global.conf like this work:
123.123.123.123/~customerID/weathercam.jpg
This results in the 'Sorry' page and a link to our system administrator email, and the subsequent email from some anonymous person who wants to see the weather.
So, how do we redirect the IP address to the customer's domain name? Would adding a redirect to /etc/apache2/conf.d/includes/pre_virtualhost_global.conf like this work:
Code:
<VirtualHost 123.123.123.123:80>
ServerName 123.123.123.123
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^\~customerID/weathercam\.jpg$ "https\:\/\/customerdomain\.com\/" [R=301,L]
</VirtualHost>