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.

CommentFileSizeAuthor
#1 2331467-1-is-active-alterer.patch507 byteshanoii
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hanoii’s picture

Status: Active » Needs review
FileSize
507 bytes
miro_dietiker’s picture

Note 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.)

hanoii’s picture

You 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.

Chris Matthews’s picture

The 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.