- http://mypage.com
- http://my-page.com
- http://www.mypage.com
- http://www.my-page.com
Here is how your .htaccess file could look like:
RewriteEngine On
rewritecond %{http_host} ^my-page\.com [nc,OR]
rewritecond %{http_host} ^www\.my-page\.com [nc,OR]
rewritecond %{http_host} ^www\.mypage\.com [nc]
rewriterule ^(.*)$ http://mypage.com/$1 [r=301,nc]
This may be useful if you want that your page is always associated with the same, unique address.
This mechanism is commonly used by webpage owners who don't want other people to earn on popularity of their pages and still their traffic. They simply buy similar domains (like in our example) and redirect them all to their main domain.