TransWikia.com

CiviCRM is defaulting to uppercase path

CiviCRM Asked by Brendan Spaar on August 30, 2021

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]

2 Answers

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.

Correct answer by Brendan Spaar on August 30, 2021

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.

Answered by Kevin Cristiano on August 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP