0

Using a routing rule in a Symfony project the function link_to (or url_for) generates an url like mydomain.com/myproject/web/friendly-name.html or mydomain.com/web/friendly-name.html There is a smart way, alternative to write own helper, to generate urls without /myproject/web or /web keeping the choosen directory structure.

Updating

Finally I found the solution in the answer to this question: symfony on virtual host document root problem

Community
  • 1
  • 1
macgyver
  • 1,279
  • 2
  • 9
  • 16
  • 1
    Duplicated maybe? http://stackoverflow.com/questions/7073121/remove-web-from-symfony-1-4-path-on-shared-hosting and http://stackoverflow.com/questions/5799050/htaccess-for-symfony-on-shared-hosting – Rui Carneiro Oct 17 '11 at 15:33
  • Thanks for your comment. No duplicated, I'm not looking for url rewriting. As written in "The Definitive Guide to Symfony", the routing system does two things: * It interprets the external URL of incoming requests and transforms it into an internal URI, to determine the module/action and the request parameters. * It formats the internal URIs used in links into external URLs (provided that you use the link helpers). I'm looking for the second thing, the url generation. – macgyver Oct 17 '11 at 21:06

1 Answers1

0

just point your webserver Document Root to /web Directory.

This is the right way of integrating symfony1.4.

Cheers malte

mblaettermann
  • 1,916
  • 2
  • 17
  • 23
  • Thanks for your answer. If we have just the hosting web, we can't change the document root, pointing the webserver directly into /myproject/web or /web. So I'm looking for generating urls without /myproject/web or /web. Then of course the url rewriting, through .htaccess, is the way to provide to the routing system the right url. – macgyver Oct 19 '11 at 09:31