.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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -