Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Can't get WordPress custom rewrite rules to work Reply To: Can't get WordPress custom rewrite rules to work

#243029
Ilan Firsov
Participant

Looks like I’ve got it to work.
First thing I moved the call to maybe_start_download() to the wp action hook.
At first it still didn’t work so I changed add_rewrite_tag( '%test%', '([^&]+)' ); to add_rewrite_tag( '%test%', '([^/]+)' ); and then it started working.
The interesting thing is that it works now even if I change the regex in add_rewrite_tag back to ([^&]+) it still works.