user979276
user979276

Reputation: 21

Symfony2 - New environnement but how to rewrite it url correctly?

I create an application on Symfony2. Everything works fine. I can access to it through the web address www.test.ch.

For some reasons, I would like to create a demo space. So I create a new vhost to work with demo.test.ch.

In Symfony2, I created a new app_demo.php which load a new environnement (espacially for the database) called demo. Everything works fine when I call demo.test.ch/app_demo.php but when I would like to skip the app_demo.php in the URL (and based on the .htaccess in the web directory of Symfony2), the URL stay demo.test.ch but the prod environnement is loaded.

My demo vhost looks like :

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName demo.test.ch

    DocumentRoot /home/www/test/current/web
    DirectoryIndex app_demo.php

    Header set Access-Control-Allow-Origin "*"

    ErrorLog /home/www/test/shared/logs/apache.demo.error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /home/www/test/shared/logs/apache.demo.access.log combined
</VirtualHost>

I think I miss something about rewrite in my vhost settings but I can't find what. Do someone has some tips for me ?

Thanks a lot !

Upvotes: 0

Views: 71

Answers (1)

Filo
Filo

Reputation: 2839

Open .htaccess located in /home/www/test/current/web

you need to change app.php with your front controller (app_demo.php)

Upvotes: 1

Related Questions