Search Engine Optimization for Modern Campus CMS Calendar
You can make the public events pages of the Modern Campus CMS Calendar friendly for search engine optimization (SEO). Optimizing for search engines removes the hash character (#) from all calendar URLs. This change requires some configuration on your production server.
These instructions assume you placed the calendar embed code on a page located at: /calendar/index.html
, otherwise adjust the configuration to meet your needs.
- Create a new file named
.htaccess
with the following content:
<IfModule mod_rewrite.c> RewriteEngine On # remove index.html if index.html is included in the URL. RewriteCond %{REQUEST_FILENAME} index.html RewriteRule (.*) /calendar/ [R=301,L] # otherwise serve everything through given directory. RewriteBase /calendar/ RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /calendar/ [L] </IfModule>
- On your production server, upload the .htaccess file to the folder where the calendar public events page is located, for example
/calendar/
. - In your embed code, add the attribute
data-basepath="/calendar/"
to the to the opening
tag.omnicms-calendar
- If the public events page of your calendar is not located at
/calendar/
, replace with your specific root-relative file path.
<omnicms-calendar data-calendar-id="6a774d2c-9735-40b7-9459-cb7d95fce228" data-basepath="/calendar/"></omnicms-calendar> <script> (function(src) { if (document.querySelector(`script[src="${src}"]`) !== null) return; const s = document.createElement('script'); s.async = true; s.src = src; s.id = 'omnicms-calendar'; document.getElementsByTagName("head")[0].appendChild(s); })('https://widget.calendar.moderncampus.net/app.js'); </script>
- If the public events page of your calendar is not located at
- Publish the page that contains the embed code, for example
/calendar/index.pcf
.- Note that the URL no longer includes a hash character (#).