.htaccess - redirect subdomain but keep URL intact -
i pointing blog.website.com
@ website.com/blog
correctly want url remain blog.website.com
here .htaccess file
rewriteengine on rewritecond %{http_host} ^blog\.website\.com$ rewriterule ^/?$ "http\:\/\/website\.com\/blog" [l]
how can this?
update
i have managed using following code in .htaccess file:
rewriteengine on rewritecond %{http_host} ^blog\.website\.com$ rewritecond %{request_uri} !^/blog/$ rewriterule (.*) http://website.com/blog/ [p]
however, blog images not showing. if put them blog
folder created subdomain, work, want keep them inside website.com/blog
folder, how can achieve this?
try rule instead:
rewriteengine on rewritecond %{http_host} ^blog\.website\.com$ rewriterule !^blog/ blog%{request_uri} [l]
Comments
Post a Comment