I have one site with wordpress that have blog page.
So now for this page Url is somthing like http://abc.com/blog.
But i want to convert this url to http://blog.abc.com
I added code in .htaccess file but rewrite is not working. Rewrite mode is also on in apache.
Any one have idea how t o change this url ?
I want to test in my local wamp first, so please give suggestion with localhost too, if possible.
Code is that i tried
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc.com/blog [NC]
RewriteRule http://blog.abc [R=301,L]
Your rule needs to look something like:
the
%{HTTP_HOST}
variable is only the hostname, and no path information is part of it (e.g./blog
). TheRewriteRule
takes at least 2 parameters: