2

We have been setting up a WordPress + CiviCRM installation on a test subdomain, let's call that wewantthis.testdomain.org.

I also have a domain name wewantthis.org that I wish to simply point to the exact same installation directory as wewantthis.testdomain.org, but with (hopefully minor) changes to settings and the database as we are not changing servers or even file locations on the server.

Note that I can do this easily for Wordpress only by

  1. using phpMyAdmin to modify the wp_options table's "siteurl" and "home" rows to point to wewantthis.org;
  2. fire up WP/wp-admin and run a Wordpress plug-in "Velvet Blues Update URLs";
  3. under WP > Settings, change the Site Address and WordPress Address to wewantthis.org. That is all there is to it. Btw, for reasons I don't want to go into, I'm not interested in a redirect solution.

Is there something similar I can do for the CiviCRM database and settings? I've read some Q/A's regarding both moving the server and changing URL, but they seem to suggest a completely new install of CiviCRM and starting over, but at least making use of the previous database, whose creation was the bulk of the work.

Any advice would be appreciated as we have a test configuration that we want to go live by simply changing DNS pointers from the existing wewantthis.org (no CiviCRM) to our new one that will have CiviCRM fully integrated.

Thanks to the experts out there. This is our first CiviCRM setup.

1 Answer 1

2

The advice in the documention is fairly old and much of it is no longer appropriate. In the most recent CiviCRM versions, more and more of the url settings are automatically calculated from the 'base url' and are relatively easy to update just by editing the CIVICRM_UF_BASEURL in your civicrm.settings.php file, and then clearing your caches for good measure. In fact, most of the time you don't even have to worry about that, you can access much of your civicrm from multiple domains (e.g. with and without www). Of course, that's not usually a good idea, and the one key time that the settings file matters is when your civicrm is invoked via a non-CMS entry point (e.g. the click-through tracking url from CiviMail).

Usually, it's when you also have to change file locations that it gets the most icky.

The one recent gotcha I've seen is a ckeditor security check for file uploads that will break things in a small way if you don't have the file locations right (e.g. you need the actual file path instead of a symlinked one). But that's a digression for completeness and unrelated to your question....

5
  • Thank you so much for the reassurance, Alan. I was also thinking of adding a 301 redirect in the .htaccess, something like: Commented Dec 6, 2016 at 18:55
  • RewriteEngine on RewriteCond %{HTTP_HOST} ^bikewalkpoway\.sdcbcdream\.org$ RewriteRule ^/?$ "http\:\/\/bikewalkpoway\.org\/" [R=301,L] Commented Dec 6, 2016 at 18:57
  • [Sorry, I don't know how to do a line feed in this comment dialog] I was just thinking there might be some lingering URL references buried somewhere and this might help. Or would it hurt? Commented Dec 6, 2016 at 18:58
  • I might add that the original subdomain will also stay live. I would want/hope either wewantthis.testdomain.org OR wewantthis.org to work, but would like to only see wewantthis.org to appear in the browser address, especially in the front-facing interface. It would be less confusing to CiviCRM and WordPress admins to also just see wewantthis.org in the address bar on back-end pages. Commented Dec 6, 2016 at 19:10
  • Yes, a redirect in the .htaccess (or apache config) to redirect all requests to your 'canonical' domain is a very good idea for two reasons: 1. SEO - you want google to be spidering your site at only one domain. 2. Authentication - relies on a cookie tied to the domain, so if you switch domains during a session, it looses it's authentication. You can do this and maintain the path portion of the request so that old links to sub pages maintain the same function/content.
    – Alan Dixon
    Commented Dec 7, 2016 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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