Search code examples
.htaccesssymfonysymfony1http-redirect

change web directory for specific urls


We have right now our frontend web site on symfony 1.4 we are looking for possibility to have symfony 3 for specific frontend urls for example http://staging.viventura.de/reisen/peru or http://staging.viventura.de/reisen/peru/xpbc

Is There a possibility to change web directory from htaccess file in order to certain urls goes to another web directory?

Thanks a lot.


Solution

  • I would use the apache mod_alias.

    ServerName staging.viventura.de
    DocumentRoot /var/www/sf-1/web
    Alias /reisen/peru /var/www/sf-3/web
    Alias /reisen/peru/xpbc /var/www/sf-3/web
    

    Assuming the main project on Symfony1 location is /var/www/sf-1, and that the Symfony3 is /var/www/sf-3.

    Note: Not allowed in .htaccess, only in httpd|apache2|[vhostname].conf config files.