Symfony 4 in subdirectory

别来无恙 提交于 2020-01-15 10:23:02

问题


I'm a French developer and I did install Symfony 4 on a subdirectory of my wamp localhost. My project is named "cardMaker".

I've a .htaccess file to redirect towards the public directory (index.php) :

<IfModule mod_rewrite.c>
  RewriteEngine On

  RewriteRule "^$" public/ [L]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . srcAngular/index.html [L]
</IfModule>

That works. But, when I open http://localhost/cardMaker/, I have this issue

How can I set the base url ?

Thank's for your responses, Sphinx


回答1:


Here at https://symfony.com/doc/current/setup/web_server_configuration.html they say:

# If you run your Symfony application on a subpath of your document root, the
# regular expression must be changed accordingly:
# ProxyPassMatch ^/path-to-app/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/public/$1


来源:https://stackoverflow.com/questions/49758336/symfony-4-in-subdirectory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!