add_rewrite_rule(
'^invite/([^/]+)',
'index.php?pagename=invite&iid=$matches[1]',
'top'
);
The “internal” rewrite rule above will route traffic through index.php
using the pagename
argument (which necessitates having a page with slug invite
).
I want to direct routing to invite.php
(which will render an ICS calendar file and force download).
I looked into the below implementation, however, this appears to directly modify .htaccess
file. My site is using nginx so this won’t work.
add_rewrite_rule(
'^invite/([^/]+)',
'invite.php?iid=$matches[1]',
'top'
);