symfony app_dev.php in folder outside document root -
i'm renovating legacy web app replacing parts of symfony.
my folder structure:
/symfony <---symfony install /trunk <---document root
the document root trunk/ changes legacy app minimal.
in virtual host config have:
<virtualhost *:80> servername webapp.example.com documentroot /path/to/project/trunk alias /ajax ../symfony/web alias /app_dev.php/ ../symfony/web/app_dev.php </virtualhost>
a request webapp.example.com/ajax works
however request webapp.example.com/app_dev.php/ajax leads 404 error.
note need rewrite paths start /app_dev.php/, ie. include trailing slash.
edit
this link apache documentation http://httpd.apache.org/docs/2.4/mod/mod_alias.html#alias
the problem seems trailing slash in end of second alias
directive
try changing this:
alias /app_dev.php/ ../symfony/web/app_dev.php
to this:
alias "/app_dev.php" "../symfony/web/app_dev.php"
from docs:
note if include trailing / on url-path server require trailing / in order expand alias. is, if use alias "/icons/" "/usr/local/apache/icons/" url /icons not aliased, lacks trailing /. likewise, if omit slash on url-path must omit file-path.
another option
if doesn't work, try removing second alias
directive, pointing symfony/web folder /ajax url path.
Comments
Post a Comment