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

nicholasthompson’s picture

Status: Active » Postponed (maintainer needs more info)

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

wayland76’s picture

I agree, but if someone wanted it as a (default unticked) option, and wrote acceptable code for it, I'd be happy with that too.

nicholasthompson’s picture

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

Freso’s picture

I 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... :))

nicholasthompson’s picture

Freso, 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."

wayland76’s picture

What more info do we need ("active (needs more info)")?

nicholasthompson’s picture

Version: 5.x-1.2 » 5.x-1.3
Status: Postponed (maintainer needs more info) » Active

I've changed it to active - but I really need an "active - in progress" status ;-)

It'll be there for 1.4

nicholasthompson’s picture

Status: Active » Closed (duplicate)

Just noticed, this is really a duplicate of #201711: New feature proposal: force specific base url.