Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
I have created 'subscribe to this site' functionality on our site, with which I would like to go live soon. People can leave their mail address and will then receive our quarterly news letter. At the bottom of the news letter will be an unsubscribe link. All this is properly working in my lab situation. However, when deployed to the Couch site, the rewrite rule as proposed by the generate .htaccess function in Couch does not work for my unsubscribe link.

My unsubscribe link would pass three parameters (act, actid and email) and would look like this:
Code: Select all
https://www.example.com/tools/unsubscribe.php?act=unsubscribe&actid=fe423428a762e22&email=me@example.com

When clicked, the home page of our site opens:
Code: Select all
https://www.example.com/

I realise this question may be out of topic as it may be more an Apache question. However, then again, it is also related to Couch since the htaccess generation is involved. I would appreciate it if someone could help me or point me in the right direction for this.
"I have never tried that before, so I think I should definitely be able to do that" - Pippi Longstocking
I assume the 'tools/unsubscribe.php' template is *not* a Couch managed one. Is that correct?
Hi KK, no, I created as a couch managed template (hidden).
"I have never tried that before, so I think I should definitely be able to do that" - Pippi Longstocking
Normal Couch templates expect a very rigid set of rewrite rules and don't tolerate any deviation - that could explain the behavior you are witnessing.

As a solution, you may try using the 'custom routes' feature -
viewtopic.php?f=5&t=8981
https://www.couchcms.com/docs/custom-routes/

Your URL (and the logic within the template) might require a little tweaking but you should be able to duplicate the existing functionality.

Hope this helps,
4 posts Page 1 of 1