currently users that want to redirect http://www.* to http://*, and visa versa, set this up in .htaccess. This is where we were previously going to perform the same redirects that global_redirect currently provides, so it seems that setting this up via global_redirect makes sense.
Comments
Comment #1
nicholasthompsonI think we'd need to check what the community want for this... I believe that Global Redirect functions best when redirect for unpredictable and dynamic situations (like node/[n] to an alias).
Redirecting the subdomain is something I believe is most efficiently handled by Apache as it removes the hit from drupal.
What do other people think.
Comment #2
wayland76 commentedI agree, but if someone wanted it as a (default unticked) option, and wrote acceptable code for it, I'd be happy with that too.
Comment #3
nicholasthompsonI suppose this could be a useful option for those whose hosts do not provice a mod_rewrite option for Apache...
I think this is could be a good feature. Thanks for the suggestion. It would have to be an option which is disabled by default though as other modules like the domain module could conflict with this feature.
Comment #4
Freso commentedI just wanted to toss in a note that mod_rewrite can be used for far more dynamic subdomain redirection, than just "www.foo" to "foo". So perhaps it would be good to make it a "catch all (and redirect to [bar.foo|foo])" option, instead of limiting it to "www." or not. (Personally, I wouldn't mind just keeping this in the .htaccess though, and I'm unlikely to use this feature as I believe it to be better to have mod_rewrite handle it, instead of first initialising Drupal with all the database connections etc... :))
Comment #5
nicholasthompsonFreso, I completely agree that using htaccess (or even config in the VHost) would be more efficient, however I think this is more an option for those on a shared host which may not allow those kinds of redirects.
I also agree that it'd be an option to redirect to a specific subdomain - not force it to "www."
Comment #6
wayland76 commentedWhat more info do we need ("active (needs more info)")?
Comment #7
nicholasthompsonI've changed it to active - but I really need an "active - in progress" status ;-)
It'll be there for 1.4
Comment #8
nicholasthompsonJust noticed, this is really a duplicate of #201711: New feature proposal: force specific base url.