.htaccess - Apache 301 Redirect from www.subdomain to domain folder -


i want redirect www.blog.domain.com

to

www.domain.com/blog/

rewritecond %{http_host} ^www\.blog\.domain\.com rewriterule ^(.*)$ http://www.domain.com/blog/$1 [r=301] 

what missing here?

those rules fine me, assuming:

  1. you've put them in htaccess file in document root of www.blog.domain.com domain
  2. you don't have other rules before redirect rules may handling request before reaches redirect
  3. the rewrite module loaded apache instance
  4. the document root configured @ least allowoverride fileinfo (or all)

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -