0

I have setup a domain with DNS etc... and wanting to point it to use the /blog folder but when you go to blog.domain.com it just redirects to domains.com/blog - i would like to retain the blog.domain.com url if possible

code im have tried

RewriteCond %{HTTP_HOST} ^blog.domain.com
RewriteRule ^(.*)$ http://domain.com/blog/$1 [L,NC,QSA]

and also tried

RewriteCond %{HTTP_HOST} ^blog\.* [NC]
RewriteRule .* http://domain.com/blog/ [L]

Thanks in advance

James Brandon
  • 1,350
  • 3
  • 16
  • 43

1 Answers1

0

This done the trick

RewriteCond %{HTTP_HOST} ^blog.domain.com$
RewriteCond %{REQUEST_URI} !blog/
RewriteRule (.*) /blog/$1 [L]
James Brandon
  • 1,350
  • 3
  • 16
  • 43