I'm try to redirect any request to mydomain.com/video/(.*) to video.mydomain.com/$1. I have the following rule:
RewriteRule ^video/(.*)$ http://video.mydomain.com/$1 [R=301,L]
But it doesn't seem to work. Instead it follows an additional r开发者_如何学编程ewrite rule which I have later which redirects all requests to index.php.
Not a direct answer to the question, but there is a simpler way to do this without mod_rewrite:
Redirect permanent /video http://video.mydomain.com/
You forgot one slash after the start anchor:
RewriteRule ^/video/(.*)$ http://video.mydomain.com/$1 [R=301,L]
精彩评论