Redirecting an old domain name to a web page
I needed to redirect globalwindday.org to www.ewea.org/globalwindday
A normal Apache redirect did not work.
For example:
globalwindday.org/faq would redirect to www.ewea.org/globalwindday/faq
This was a page that did not exist so therefore resulted in a 404 error.
Here are the lines added to vhosts.conf to make it work (stripping sub pages):
<VirtualHost *:80>
ServerName globalwindday.org
ServerAlias www.globalwindday.org
# Redirect permanent / http://www.ewea.org/globalwindday/ <-- This did not work
RewriteEngine On
RewriteCond %{HTTP_HOST} globalwindday.org [NC]
RewriteRule ^(.*)$ http://www.ewea.org/globalwindday/ [R=301,NC]
</VirtualHost>
As constructed from this reference page:
https://gist.github.com/ScottPhillips/1721489
No comments yet.