2

I have a directory called web in the root folder. In this directory there are 2 file called app.php and app_dev.php. (It come from symfony 2.5.5)

I would like to redirect user from root directory to /web/app.php If the user enter www.mywebsite.com/hello he has to be redicted to www.mywebsite.com/web/app.php/hello

and if it is possible, www.mywebsite.com/dev/test would redirect to www.mywebsite.com/web/app_dev.php/test

I think its possible with htaccess but I don't find how. Please help me.

PS: sorry for my bad english, it's not my native language.

X4V1
  • 75
  • 2
  • 9
  • Check out `RewriteRule`. Also, check out this question and see if it is pertinent to what you are trying to do. [Symfony2 Rewrite](http://stackoverflow.com/questions/11149526/symfony2-rewrite-rules-htaccess-app-php) – Matt Clark Oct 22 '14 at 16:09
  • The answer is related to your server configuration. What are you using? What's the configuration? – nachinius Oct 22 '14 at 16:10

1 Answers1

2

Try this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^dev(.*) app_dev.php$1 [L]
RewriteRule . app.php [L]
</IfModule>
motanelu
  • 3,945
  • 1
  • 14
  • 21