I'm having some issues with passing an email address in a url to a symfony app.
The url looks like
example.com/unsubscribe/email/[email protected]
It will always result in a sfError404Exception
, except when the period is removed. After doing some googling around, the only solution I've yet seen is that htaccess is bypassing the url because of the period present. However, when I add the suggested fix to htaccess, like so:
# we skip all files with .something
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !@.+ #skip email address
RewriteCond %{REQUEST_URI} \.epl$
RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !\.rhtml$
RewriteRule .* - [L]
I get the same 404. It also returns 404 when I use the front controller directly in the url (example.com/index.php/unsubscribe/email/[email protected]
). I've tried putting the escaped version directly into the address bar, eg example.com/unsubscribe/me%40example%2Ecom
and this works, but only in firefox, nowhere else.
I've spent about 2 hours in forum answer googling hell at this point and I'm running out of ideas.
Any thoughts?
Thanks.
Update: Here is the relevant section of the routing.yml:
unsubscribeform:
url: /unsubscribe/email/:email
param: { module: subscribe, action: index }
Update: Stack trace ... looks like its not getting any route information to go on to me
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.