2

I've been searching for a way to remove the "/web/" folder from an application URL in a shared environment, in which I cannot change the DocumentRoot or create a VirtualHost.

I found some solutions based on mod_rewrite, but all of them apply to Symfony 1.x, or they just don't work (I'm very new to mod_rewrite anyway, so it may be my fault).

Is there a way to do this with Symfony 2?

3
  • Possible duplicate Commented Aug 13, 2012 at 6:55
  • That's one of the solutions based on mod_rewrite that I tried, but it doesn't work for me :( It just spits a 404 :( Commented Aug 13, 2012 at 6:57
  • Are you sure that mod_rewrite is enabled in your system? Maybe that is why the rewrite solutions don´t work Commented Aug 13, 2012 at 7:47

1 Answer 1

4

You have to set web server's document root pointing to your "Web" directory. If you can't customize document root just move content of your "web" directory directly into document root and move all other staff one level above. For example:

/home/username/www/html <---- this is the place where you put all things from "web" /home/username/www/src <---- and all other things one level above /home/username/www/app /home/username/www/vendor ... 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.