Answers.Body: <p>Using nginx it's possible to catch these links and redirect:</p>
  
  <p>In the relevant server block add a location match on /civicrm/event/info</p>
  
  <p>then redirect this to https://$server_name/?page=CiviCRM&amp;q=civicrm%2Fevent%2Finfo&amp;reset=1&amp;$args</p>
  
  <p>So it will look like this:</p>
  
  <pre><code>location /civicrm/event/info {
    return 301 https://$server_name/?page=CiviCRM&amp;q=civicrm%2Fevent%2Finfo&amp;reset=1&amp;$args;
  }
  </code></pre>
  
  <p>By comparing other urls you can catch contribution pages and others as well.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-18T01:38:55.853Z
Answers.LastActivityDate: 2019-06-18T01:38:55.853Z
Answers.UserDisplayName: Luke Stewart
Answers.Body: <p>You can keep the URLs you're currently using - as long as you're using a recent version of CiviCRM - simply by adding this to your <code>wp-config.php</code> file:</p>
  
  
  
  <pre><code>define( 'CIVICRM_CLEANURL', 1 );
  </code></pre>
  
  <p>This will create URLs in the same format as Drupal ones, i.e.</p>
  
  <pre><code>https://domain.com/civicrm/event/info?reset=1&amp;id=3
  </code></pre>
  
  <p>This does assume that you are using the default base page named "CiviCRM" with the slug <code>civicrm</code>. If this page doesn't exist, then create it and add the slug to the setting in the CiviCRM "CMS Database Integration" admin page. You may also need to visit the WordPress "Permalinks" page to refresh your rewrite rules so that Clean URLs work as expected.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-19T08:30:13.640Z
Answers.Text: I forgot to add: if you're having issues with refreshing rewrite rules, apply this patch to the WordPress plugin: https://github.com/civicrm/civicrm-wordpress/commit/92468b8de68332fcfe1a502a4e3c6b5e14fae27d
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-18T10:12:24.543Z
Answers.LastActivityDate: 2019-06-18T10:12:24.543Z
Answers.UserDisplayName: Christian Wach
Body: <p>After migrating from Drupal to wordpress links to event info pages for example no longer work - as these have been shared already is there a way to redirect these?</p>
  
Tags: <wordpress><nginx>
Title: Migrating Drupal to wordpress redirect existing links
ThreadText: # Migrating Drupal to wordpress redirect existing links
  
  (Asked by: username_0 on 2019-06-18)
  
  After migrating from Drupal to wordpress links to event info pages for example no longer work - as these have been shared already is there a way to redirect these?
  
  **Tags:** wordpress, nginx
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-06-18. Score: 5 | Accepted answer
  
  You can keep the URLs you're currently using - as long as you're using a recent version of CiviCRM - simply by adding this to your `wp-config.php` file:
  
  ```
  define( 'CIVICRM_CLEANURL', 1 );
  
  ```
  
  This will create URLs in the same format as Drupal ones, i.e.
  
  ```
  https://domain.com/civicrm/event/info?reset=1&id=3
  
  ```
  
  This does assume that you are using the default base page named "CiviCRM" with the slug `civicrm`. If this page doesn't exist, then create it and add the slug to the setting in the CiviCRM "CMS Database Integration" admin page. You may also need to visit the WordPress "Permalinks" page to refresh your rewrite rules so that Clean URLs work as expected.
  
  > **Comments:**
  > **username_1**: I forgot to add: if you're having issues with refreshing rewrite rules, apply this patch to the WordPress plugin: https://github.com/civicrm/civicrm-wordpress/commit/92468b8de68332fcfe1a502a4e3c6b5e14fae27d  
  
  ---
  
  ### Answer by username_0 on 2019-06-18. Score: 3
  
  Using nginx it's possible to catch these links and redirect:
  
  In the relevant server block add a location match on /civicrm/event/info
  
  then redirect this to https://$server\_name/?page=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&$args
  
  So it will look like this:
  
  ```
  location /civicrm/event/info {
    return 301 https://$server_name/?page=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&$args;
  }
  
  ```
  
  By comparing other urls you can catch contribution pages and others as well.
  
  
  ---
  
  