Wednesday, 9 February 2011

Redirect to different domain in .htaccess

If you own several domains pointing to the same page and would like to enforce users to always use the same domain you can use apache mod_rewrite by editing .htaccess file. Let's say you own
  • http://mypage.com
  • http://my-page.com
  • http://www.mypage.com
  • http://www.my-page.com
but you want that everybody uses only the http://mypage.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.

Wednesday, 2 February 2011

.NET Reflector not free anymore

For those of you who use RedGate's .NET Reflector I have a sad news. I just received an email stating that they are changing their policy and .NET reflector won't be a free tool anymore :(
Starting from version 7 it will cost you 35$ for a perpetual license. Apparently they can afford working on this for free. You can read more on this decision here.

What is .NET Reflector?
For those of you who doesn't know the tool - it's a very good class browser, analyzer and decompiler for .NET. I use it quite often to decompile dlls if I need to check what's actually in there.

Can you recommend a similar free tool?