1
votes

I need to rewrite and 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?

1

1 Answers

2
votes

Put following line in .htaccess of root

RewriteRule ^foo/(.*) http://www.project2.com/bar/$1 [QSA,L,R=302]