I am working on a site in which I want to use the node/xxx URL for facebook comments so I can be independent of the alias I chose, comments would still be tied to one unique URL.
The best way I could achieve this is not to global redirect node/xxx URLs for a specific user agent that facebook uses.
I thought of adding a setting to your module to except user agents, but I think that's adding too much for my specific use case, although I think it's useful.
What I came up with, is to use an alterer, allowing external modules to modify the status of the global redirect, preventing to run. With this, other modules can interact with yours pretty seamlessly.
It's a very simple patch with zero (or almost) bad outcome.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2331467-1-is-active-alterer.patch | 507 bytes | hanoii |
Comments
Comment #1
hanoiiComment #2
miro_dietikerNote that this kind of altering is not compatible with any kind of edge cache (varnish) and needs special adaption / configuration at least.
(Background: Edge caches like varnish store redirects, too, like any other http response.)
Comment #3
hanoiiYou are right! And because of this I ended up removing this, however, I do think is a nice addition all along, as it allows a lot more flexibility.
Comment #4
Chris Matthews CreditAttribution: Chris Matthews commentedThe 4 year old patch in #1 to globalredirect.module applied cleanly to the latest 7.x-1.x-dev, but still needs community review & testing.