I'm creating a (calendar) plugin where one feature is the ability to download an event as a .ics-file. To do that I have a file called ics.php in which I generate an .ics-file based on the id of the event, passed by a querystring. So far everything works.
header('Content-type: text/calendar; charset=utf-8'); header('Content-Disposition: inline; filename=event.ics'); // output...
However, after changing permalink structure from the default to month and name, everytime the file is generated the browser can't find it. (net::ERR_FILE_NOT_FOUND in Chrome, and "File not found" in Firefox).
I can access ics.php but when I add the id of the event to be parsed (ics.php?e=5) I get the above mentioned error. I want the users to be able to use any kind of permalink structure with the plugin, so I need a solution to this.
Maybe worth mentioning is that the events are stored as custom post types.