I have two ec2 servers in which one is running my website and another is blog with sub-domain. Both are having apache2 installed.
How can i redirect http://www.example.com/blog
to blog.example.com
?
You can use mod_rewrite.
Create .htaccess file in root containing
RewriteEngine On
RedirectMatch 301 ^/blog http://blog.example.com/