Back to Linux Basement

Apache2 rewrite for URL redirects | Linux Basement Presents: Chad's Blog

Apache2 rewrite for URL redirects

If you have an old domain, that you want forwarded to a new domain, you can use the mod_rewrite module to automatically rewrite the url.

This should be put in the mod_rewrite section of the .htaccess file
under the root of the web server so that all requests for
yourolddomain.com are rewritten to yournewdomain.com

RewriteCond %{HTTP_HOST} ^yourolddomain.com$ [NC]
RewriteRule .* http://yournewdomain.com/ [L,R=301
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
Tuesday, August 14th, 2007 Open Source, technology, web design

No comments yet.

Leave a comment

You must be logged in to post a comment.

Search

 

Chad's Twitter

Favorites