Symfony网站与WampServer,仅显示首页。

huangapple go评论57阅读模式
英文:

Symfony website with WampServer that displays only the home page

问题

I have a Symfony site that works perfectly locally. Now I try to put it on a server with WampServer. Once I launch the virtual host of Wamp, I arrive on the home page of my site (the login page) but once I manage to connect, I get the page :

Not Found
The requested URL was not found on this server.
Apache/2.4.54 (Win64) PHP/8.2.6 mod_fcgid/2.3.10-dev Server at itp-consult Port 80 

I've tried like said here :
https://symfony.com/doc/current/setup/web_server_configuration.html
to add the symfony/apache-pack bundle and I modified the .htaccess file but nothing changed.

英文:

I have a Symfony site that works perfectly locally. Now I try to put it on a server with WampServer. Once I launch the virtual host of Wamp, I arrive on the home page of my site (the login page) but once I manage to connect, I get the page :

Not Found
The requested URL was not found on this server.
Apache/2.4.54 (Win64) PHP/8.2.6 mod_fcgid/2.3.10-dev Server at itp-consult Port 80 

I've tried like said here :
https://symfony.com/doc/current/setup/web_server_configuration.html
too add the symfony/apache-pack bundle and i modified the .httpaccess file but nothing changed.

答案1

得分: 1

你不应该修改由symfony/apache-pack创建的文件。
该捆绑包在public/目录中生成一个文件,您应该从那里提供您的网站。请确保不要从Symfony项目的根目录提供服务。(https://symfony.com/doc/current/deployment.html#symfony-deployment-basics)
另外,我假设这是一个拼写错误,但只是为了确保:文件的名称应该是.htaccess,而不是.httpaccess
希望这有所帮助。

英文:

You should not be modifying the file created by symfony/apache-pack.
The bundle generates a file in the public/ directory which you should be serving your website from. Make sure you're not serving from the root of your Symfony project. (https://symfony.com/doc/current/deployment.html#symfony-deployment-basics)
Also I assume it is a typo but just to make sure : the name of the file should be .htaccess, not .httpaccess.
Hope this helps.

huangapple
  • 本文由 发表于 2023年5月10日 22:02:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76219359.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定