我在将URL中的电子邮件地址传递给symfony应用程序时遇到了一些问题。Symfony:电子邮件地址作为请求参数
的URL看起来像
example.com/unsubscribe/email/[email protected]
它总是导致sfError404Exception
,当周期被移除时除外。在做了一些Google搜索之后,我唯一看到的解决方案就是htaccess正在绕过网址,因为这段时间是现在。然而,当我添加修复建议,以htaccess的,就像这样:
# we skip all files with .something
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} [email protected]+ #skip email address
RewriteCond %{REQUEST_URI} \.epl$
RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !\.rhtml$
RewriteRule .* - [L]
我会得到相同的404它也返回404当我在URL(example.com/index.php/unsubscribe/email/[email protected]
)直接使用前端控制器。我试图将转义版本直接放到地址栏中,例如example.com/unsubscribe/me%40example%2Ecom
,这个方法可行,但只适用于firefox,其他地方不适用。
我已经花了大约2个小时在这个论坛上回答了Google地址,并且我正在用尽想法。
有什么想法?
谢谢。
更新:这里是routing.yml中的相关章节:
unsubscribeform:
url: /unsubscribe/email/:email
param: { module: subscribe, action: index }
更新:堆栈跟踪...看起来像它没有得到任何路由信息去给我
404 | Not Found | sfError404Exception
Empty module and/or action after parsing the URL "/unsubscribe/email/[email protected]" (/).
stack trace
1. at()
in SF_SYMFONY_LIB_DIR/controller/sfFrontWebController.class.php line 44 ...
41.
42. if (empty($moduleName) || empty($actionName))
43. {
44. throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
45. }
46.
47. // make the first request
2. at sfFrontWebController->dispatch()
in SF_SYMFONY_LIB_DIR/util/sfContext.class.php line 159 ...
156. */
157. public function dispatch()
158. {
159. $this->getController()->dispatch();
160. }
161.
162. /**
3. at sfContext->dispatch()
in /home/web/htdocs/index.php line 10 ...
7. require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'ProjectConfiguration.class.php');
8.
9. $configuration = ProjectConfiguration::getApplicationConfiguration(SF_APP, SF_ENVIRONMENT, SF_DEBUG);
10. sfContext::createInstance($configuration)->dispatch();
11.
+1,因为我认为我将运行到这个问题,以及 – 2009-10-19 20:32:18