Redirect Apache ServerAlias to ServerName

Ryan Server

I had a website that was moved to a new domain name but I wanted to make all the old URLs redirect to the new domain. However, redirecting using a typical .htaccess redirect as shown below wouldn’t work because it was new using the old domain as a ServerAlias to the new domain/ServerName. RewriteEngine on RewriteCond %{HTTP_HOST} ^example.com$ [OR] RewriteCond …