我有 Symfony 1.4 网络应用程序。假设我的应用托管在 example.com 上,并且那里有常见问题解答页面。
当我这样引用我的应用程序时:http ://example.com/faq#faq1一切正常。但是当“#”被转义时:http ://example.com/faq%23faq1
我在 symfony 生成的日志中看到以下消息:
[err] {sfError404Exception} Empty module and/or action after parsing the URL "/faq#faq1" (/).
因此,看起来 Symfony 识别出“#”但未能正确路由它。
路由.yml:
faq:
url: /faq
param: { module: static, action: faq }
requirements:
sf_method: [get]
如何使 Symfony 正确路由带有转义字符的 URL?