Currently I am doing a small code in symfony that will cause url have resource like this:
http://url/val/abc.abxhd
I was able to get the parameter abc successfully from http://url/val/abc
, but w开发者_运维技巧hen I try to run the URL of http://url/val/abc.abxhd
. Symfony simply throw a 404 error.
What could be the problem here. the URl are written using rawurlencode also.
group:
url: /group/:group
param: {module: group, action: show}
requirements:
sf_method: [get]
Actually symfony was finding dot (.) as a segment separator. This is the reason why in my case it cannot find the route. After Add the ff to my route. it works just like expected:
group:
url: /group/:group
param: {module: group, action: show}
requirements:
sf_method: [get]
options:
segment_separators: [/]
Seems like Symfony doesn't like dots .
in urls : http://groups.google.com/group/symfony-users/browse_thread/thread/65d928b601bff9f4/096af0fcc478997b?pli=1
Users provide several tips and solutions.
What you can do is to handle this with url rewriting (as suggested in the thread) but take care not to rewrite files (meaningly: http://url/folder/myjquery.js
)
精彩评论