.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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -