wardjame
asked on
htaccess redirect with or without www to static page
I need to redirect a new domain to a static page within an existing domain. Here is the code I am using right now that appears to work ok:
I would like to change this code so it will work with or without the www before newdomain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.newdomain.com
RewriteRule (.*) http://www.olddomain.com/page.html [R=301,L]
I would like to change this code so it will work with or without the www before newdomain.com
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't have system to test it right now. I have removed ^ as well. It should work with both. Otherwise, you can get rid of the RewriteCond completely. That would do it.
ASKER
Won't that mean it will only work without www and not with? I need both to work.