php - Symfony baseUrl doesn't respond to apache rewrites and breaks all routes -
imagine simple symfony install:
symfony new testsite now imagine inside webroot of apache server. of course won't work since symfony webroot in /web/ folder.
so make simple rewriterule , drop in htaccess in symfony folder:
rewriteengine on rewriterule ^(.*)$ web/$1 [qsa,l] and works. hooray! try out "create first page in symfony" guide , lo , behold controller's 404ing!

so seems symfony cutting off 3 characters start of path. bit of debugging shows it's getting base url $_server['script_name'] cause of problem, since doesn't change when rewrite url.
is there proper way fix or have redefine script_name manually in app.php?
if comments correct, url should using is:
symfony-test.local/web/app_dev.php/lucky/number you should specify documentroot web/ folder! done. read more details: http://symfony.com/doc/current/setup/web_server_configuration.html
Comments
Post a Comment