/blog/

Sep 28 2009

CMS Made Simple: More Update Woes

Category: CMS Made Simple

Just when everything seems to run smoothly, just the it's the perfect time for postponed and long overdue updates. And there are always postponed and overdue updates and never enough time. When I made to long overdue update to Cms Made Simple 1.6.5 is was surprised that it worked without any glitch - or so I thought.

 

It turned out later that some modules wouldn't work: The FormBuilder and Newsletter (NMS) modules didn't accept user-input. Submitting forms just failed work and the script completely ignored the POST-request. I tested the same CMS version and modules on another server with an almost identical setup and there forms were working just fine. The only major difference between both setups were the RewriteRules in the .htaccess file. On the web server where forms were not working the .htaccess rewrites the URL with mod_rewrite so that www.example.com/foobar would become www.example.com/foobar/. This configuration will not show a file extension on page URLs. Instead pages will look like directories - a common setup.

 

While it is fine to add a slash for most URLs, it will break POST-Requests in CMS Made Simple 1.6.5. The solution is to implement another RewriteRule or to alter the existing Rewrite-Conditions to exempt POST-Requests from rewriting rules:

 

# 301 Redirect all requests that don't contain a dot
# or trailing slash to include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
# excempt POSTS-requests
RewriteCond %{REQUEST_METHOD} !POST$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

 

If you run into into a similar obstacle after upgrading to CMS Made Simple 1.6.5 here is the full discussion: http://forum.cmsmadesimple.org/index.php/topic,37175.0.html.

 

[ Back to table of contents ]