By elhombresinatributos on
Hi all.
I'm using this rewrite rules to convert the querys to http://example.com to http://www.example.com
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule .* http://www.example.com/ [L,R=301]
The problem comes when someone tries to access directly:
http://example.com/2006/06/some_article
because instead of rewriting it to:
http://www.example.com/2006/06/some_article
the rewrite goes to:
http://www.example.com
Does anyone know how to avoid this behavior?
Thanks a lot!
S.
Comments
Add the requested URL
Hello, try this:
You forgot the requested URL in the rewrite rule :)
Thanks a lot
As you say, I forgot (not really because I didn't knew it existed) the requested URL.
Thanks, it works perfectly now.