2

Somehow CiviCRM is wanting to use the path /CiviCRM (notice the case) instead of all lowercase civicrm. This has been fine until I upgraded to Civi 5.27 and now the civicrm?civiwp implementation results in a 404. I can change the case manually and it will work but the automatically generated URLs use all lowercase.

For example: https://www.domain.org/civicrm?civiwp=CiviCRM&q=civicrm%2Fevent%2Fregister&reset=1&id=24 == 404 Not Found

https://www.domain.org/CiviCRM/?civiwp=CiviCRM&q=civicrm%2Fevent%2Finfo&reset=1&id=24 == working

This is also breaking images in my Mosaico templates.

Example of a Mosaico image: https://www.domain.org/civicrm?civiwp=CiviCRM&q=civicrm%2Fmosaico%2Fimg&src=https%3A%2F%2Fwww.domain.org%2Fwp-content%2Fuploads%2Fcivicrm%2Fpersist%2Fcontribute%2Fimages%2Fuploads%2Fdcs_e1de5c0ee5de2a85bb86821132d2aaba.png&method=resize&params=166%2Cnull

If you change the link to /CiviCRM?civiwp=CiviCRM.... it works.

I have verified that the permalink on the page is lowercase as well as the CMS Database Integration in Civi. Has anyone seen this behavior or have any suggestions for how I can correct it?

UPDATE:

Adding the following lines to my htaccess fixes this as a workaround. Still not sure why it is defaulting to CiviCRM instead of civicrm. Hopefully if this is happening to you, you can use this patch.

RewriteCond %{REQUEST_URI} !^/wp-content/
RewriteRule ^(.*)/civicrm(.*)$ /$1/CiviCRM/$2 [R,L]
0

Can you check the CMS Settings https://yoursite.org//wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fsetting%2Fuf&reset=1 and see what you see?

I suspect it looks like:

enter image description here

Can you also check the WP Page 'CiviCRM' I suspect the slug is not 'civicrm' lowercase. These values must match in order for the urls to resove.

| improve this answer | |
  • Hi Kevin, thanks for the quick reply. Both the page slug and Base Page are lowercase. I've updated my question with the screenshots of each. – Brendan Spaar Jul 9 at 21:36
  • That is really odd. As they both match it should work. Is it possible there is a civicrm folder in the web root – Kevin Cristiano Jul 10 at 22:17
  • Even stranger is that if you go to /civicrm it gives you a server side 404. If you go to any other non existent folder (ie. /civistack) it will serve a html page 404. I can't even do a 301 rewrite for the /civicrm folder to force it to CiviCRM. This is really strange. – Brendan Spaar Jul 11 at 0:25
  • Can anyone add further suggestions or insight? This is breaking Mosaico templates and we're not able to send mailings. See the two new examples in the original post. Could I use a rewrite in the htaccess to rewrite all requests for civicrm?civiwp= to CiviCRM?civiwp= ? If so, how would I do that? Thanks! – Brendan Spaar Jul 20 at 15:28
  • Partial answer... adding the following in htaccess fixes the links but breaks the admin pages for civi... getting closer to a workaround... RewriteRule ^(.*)/civicrm(.*)$ /CiviCRM/$2 [L] RewriteRule ^(.*)/civicrm(.*)$ /$1/CiviCRM/$2 [R,L] – Brendan Spaar Jul 20 at 16:36
0

This is a .htaccess workaround but I have tested and verified that it works. Please the following in your root .htaccess file or httpd-app.conf:

RewriteCond %{REQUEST_URI} !^/wp-content/
RewriteRule ^(.*)/civicrm(.*)$ /$1/CiviCRM/$2 [R=301,L]

If someone from the community cares enough to look into why this is defaulting to CiviCRM when everything is set to civicrm, please do. Otherwise this band-aid will have to do.

| improve this answer | |

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.