When .ical is generated by WordPress plugin download it as .ics

I’ve a plugin installed in WordPress which came with a theme we’ve purchased and it is working great. There is only one thing that needs to be changed. The downloadable calendar files have a .ical extension and I need it to be an .ics extension. I can change the extension manually after download and it works fine.
However I tried changing the plugin itself, and altering some code gave the desired result, however I can’t auto-update the plugin any longer. My idea was to change every .ical to .ics using .htaccess, because if I could make this work, it would be the best solution. However I’m not sure if I’m doing this right. (By the way the .ical are generated by accessing the /calendar/feed/ical url, then generated and instantly downloaded, so no actual files, just virtual ones).

I got this right now but it’s not working (it just downloads the .ical)

RewriteEngine On
RedirectMatch "^(.*).ical$" "$1.ics"

Read more here: When .ical is generated by WordPress plugin download it as .ics

Leave a Reply

Your email address will not be published. Required fields are marked *