I need to rewrite subdomain for local environment using htaccess.
I have enabled virtual host in local and its working.
Rewrite
<link href="http://cdn.example.com/css.css" rel="stylesheet" type="text/css" />
to
<link href="http://cdn.localhost/css.css" rel="stylesheet" type="text/css" />
I am trying this way but its not working
Rewritecond %{HTTP_HOST} ^cdn.example.com [NC]
Rewriterule ^(.*)$ cdn.localhost/$1 [L,NC,QSA]
I just need to rewrite http://cdn.example.com
to http://cdn.localhost
http://localhost
is loacted in D:\wamp\www\example
http://cdn.localhost
is loacted in D:\wamp\www\cdn
Please see and suggest any possible way to do this
Thanks.
You're missing
http://
in your target URI andR
flag will also be implied once you usehttp://
in target URL.Following rule should work: