.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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -