mod_rewrite for directory to another host
I need to rewrite an开发者_如何转开发d redirect all access to a directory to another host. I'm using Symfony2 framework and the .htaccess is in the /web directory (also the root of the virtualhost) and looks like:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L]
I want all access to http://www.project1.com/foo redirected to http://www.project2.com/bar
How can I do that with htaccess?
Put following line in .htaccess of root
RewriteRule ^foo/(.*) http://www.project2.com/bar/$1 [QSA,L,R=302]
精彩评论