Body: <p>When a customer clicks on the optOutUrl in a mail we sent him, he is directed to <a href="https://mysite.com/civicrm/mailing/url/?u=20&amp;qid=1868" rel="nofollow noreferrer">https://mysite.com/civicrm/mailing/url/?u=20&amp;qid=1868</a>, but for some absurd reason, the web server redirects him to <a href="https://mysite.com/civicrm/mailing/url/%7Baction.optOutUrl/" rel="nofollow noreferrer">https://mysite.com/civicrm/mailing/url/{action.optOutUrl/</a> which causes an error saying:</p>
  <blockquote>
  <p>Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.</p>
  <p>Could not find valid value for u</p>
  </blockquote>
  <p>As far as I understand, this can only be a bug caused by CiviCRM itself, because no other part of the software can know that the URL expression <code>?u=20&amp;qid=1868</code> is related to <code>{action.optOutUrl}</code>, more specifically in some <code>.htaccess</code> rewrite rule.</p>
  <p>I didn't find yet any <code>.htaccess</code> file having such a rewrite rule.</p>
  <p>Any help would be appreciated for fixing this.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-08T15:46:41.483Z
Comments.Text: Two things: (a) I notice there is no `}` at the end of the redirected url. Does your message template have the `}` in the token? (b) Check what gets stored in civicrm_mailing_trackable_url - is it the correct url?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-06-10T07:55:01.320Z
Comments.Text: The error has been fixed. For some unknown reason, the opt out link was changed from `<a href="{action.optOutUrl}">` into `<a href="%7Baction.optOutUrl%7D">`. Restoring the `{}` did the trick. Still not convinced about what is happening exactly.
Comments.UserDisplayName: Pierre François
Tags: <civimail>
Title: Absurd redirection resulting in "Could not find valid value for u" error
ThreadText: # Absurd redirection resulting in "Could not find valid value for u" error
  
  (Asked by: username_0 on 2024-06-08)
  
  When a customer clicks on the optOutUrl in a mail we sent him, he is directed to <https://mysite.com/civicrm/mailing/url/?u=20&qid=1868>, but for some absurd reason, the web server redirects him to [https://mysite.com/civicrm/mailing/url/{action.optOutUrl/](https://mysite.com/civicrm/mailing/url/%7Baction.optOutUrl/) which causes an error saying:
  
  > Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
  >
  > Could not find valid value for u
  
  As far as I understand, this can only be a bug caused by CiviCRM itself, because no other part of the software can know that the URL expression `?u=20&qid=1868` is related to `{action.optOutUrl}`, more specifically in some `.htaccess` rewrite rule.
  
  I didn't find yet any `.htaccess` file having such a rewrite rule.
  
  Any help would be appreciated for fixing this.
  
  **Tags:** civimail
  
  > **Comments:**
  > **username_1**: Two things: (a) I notice there is no `}` at the end of the redirected url. Does your message template have the `}` in the token? (b) Check what gets stored in civicrm_mailing_trackable_url - is it the correct url?  
  > **username_0**: The error has been fixed. For some unknown reason, the opt out link was changed from `<a href="{action.optOutUrl}">` into `<a href="%7Baction.optOutUrl%7D">`. Restoring the `{}` did the trick. Still not convinced about what is happening exactly.  
  
  ---
  
  ## 0 answers
  
  