Answers.Body: <p>Instead of setting the event link path to the relative path<br />
  <code>civicrm/event/info/?reset=1&amp;id=[id]</code>, use the absolute path<br />
  <code>https://mysite.com/civicrm/event/info/?reset=1&amp;id=[id]</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-18T21:06:35.313Z
Answers.LastActivityDate: 2023-10-21T18:03:56.300Z
Answers.LastEditDate: 2023-10-21T18:03:56.300Z
Answers.UserDisplayName: Torben Gundtofte-Bruun
Body: <p><strong>What I have:</strong></p>
  <ol>
  <li>test setup <code>mysite.com</code> using newest WP 6.3.2 and newest CiviCRM 5.66.0</li>
  <li>CiviEvent: several events.</li>
  <li>SearchKit: a search that gives me the results I want.<br />
  One column has a link with the path <code>civicrm/event/info/?reset=1&amp;id=[id]</code></li>
  <li>Form Builder: a form to hold the results from the search.</li>
  <li>WordPress: a page that contains the shortcode with my search: <code>[civicrm component=&quot;afform&quot; name=&quot;afsearchFoo&quot;]</code></li>
  </ol>
  <p><strong>Problem: event link is broken:</strong></p>
  <ul>
  <li>The link given in step 3 above as <code>civicrm/event/info/?reset=1&amp;id=10</code><br />
  <strong>should</strong> become: <code>https://mysite.com/civicrm/event/info/?reset=1&amp;id=10</code><br />
  <strong>actually</strong> becomes: <code>https://mysite.com/courses/?civiwp=CiviCRM&amp;q=civicrm%2Fevent%2Fregister&amp;reset=1&amp;id=10</code></li>
  <li>Notice that <code>/</code> changed to <code>%2F</code>, and</li>
  <li>Notice that the path includes the page slug (<code>/courses/</code>) where the shortcode is embedded.</li>
  </ul>
  <p><strong>What I want:</strong></p>
  <ul>
  <li>The link should not be URLencoded and appended. How do I fix that?</li>
  </ul>
  
Tags: <wordpress><civievent>
Title: CiviEvent generates invalid link
ThreadText: # CiviEvent generates invalid link
  
  (Asked by: username_0 on 2023-10-18)
  
  **What I have:**
  
  1. test setup `mysite.com` using newest WP 6.3.2 and newest CiviCRM 5.66.0
  2. CiviEvent: several events.
  3. SearchKit: a search that gives me the results I want.  
     One column has a link with the path `civicrm/event/info/?reset=1&id=[id]`
  4. Form Builder: a form to hold the results from the search.
  5. WordPress: a page that contains the shortcode with my search: `[civicrm component="afform" name="afsearchFoo"]`
  
  **Problem: event link is broken:**
  
  * The link given in step 3 above as `civicrm/event/info/?reset=1&id=10`  
    **should** become: `https://mysite.com/civicrm/event/info/?reset=1&id=10`  
    **actually** becomes: `https://mysite.com/courses/?civiwp=CiviCRM&q=civicrm%2Fevent%2Fregister&reset=1&id=10`
  * Notice that `/` changed to `%2F`, and
  * Notice that the path includes the page slug (`/courses/`) where the shortcode is embedded.
  
  **What I want:**
  
  * The link should not be URLencoded and appended. How do I fix that?
  
  **Tags:** wordpress, civievent
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-10-18. Score: 2 | Accepted answer
  
  Instead of setting the event link path to the relative path  
  `civicrm/event/info/?reset=1&id=[id]`, use the absolute path  
  `https://mysite.com/civicrm/event/info/?reset=1&id=[id]`.
  
  
  ---
  
  