1

All,

This post https://forum.civicrm.org/index.php?topic=34829.0 describes the problem I just experienced. I was able to work around the issue by deleting www from the address in the address bar. Obviously, this is not a solution.

What is the proper way to solve this problem?

2

Ensure that your site is accessible via a single canonical hostname. Configure your webserver or CMS to redirect requests for other hostnames to the canonical hostname.

Currently your site is permitting people to browse on both www.example.org and example.org. While this works fine for Drupal/Joomla/WordPress, CiviCRM doesn't handle it well, and you'll see form submission errors or CORS issues.

By configuring a canonical hostname redirect, visitors hitting the wrong URL (eg www.example.org/donate) will be immediately redirected to the preferred hostname (eg example.org/donate).

The following settings must match:

  • canonical hostname in your webserver or CMS configuration (varies by software in use)
  • Base URL in CMS config (Wordpress: wp_options table; Drupal: $base_url in settings.php; Joomla!: _______?)
  • CIVICRM_UF_BASEURL configured in civicrm.settings.php
  • Resource URLS in civicrm admin section

Make sure to check both scheme (http:// vs https://) and hostname (example.org vs www.example.org vs www2.example.org). Some modules or extensions (eg Drupal "secure pages") that offer redirects will also need to be considered/configured.

Configuring canonical hostname redirect is recommended for SEO as well as because it makes civicrm behave much better :)

| improve this answer | |
  • Thank you for the thorough answer. I found the two lines in .htaccess that needed to be uncommented. – GRoston Oct 5 '15 at 3:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.