It seems there is a bug in /http/Provision/Config/Apache/vhost.tpl.php.
If you add an alias with the redirection flag set to true, it will redirect to true.com.

elseif (!$ssl_redirection && $this->redirection) {
  // Redirect all aliases to the main http url.
  print " RewriteCond %{HTTP_HOST} !^{$this->redirection}$ [NC]\n";
  print " RewriteRule ^/*(.*)$ http://{$this->redirection}/$1 [NE,L,R=301]\n";
}

$this->redirection should be $this->uri.

CommentFileSizeAuthor
#1 bad_redirect-2148671-1.patch1.46 KBlogaritmisk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

logaritmisk’s picture

logaritmisk’s picture

Status: Active » Needs review
anarcat’s picture

Status: Needs review » Fixed

I committed this, but in the future, please make sure your patch doesn't mix whitespace changes with regular changes.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

lavamind’s picture

Priority: Normal » Major
Status: Closed (fixed) » Needs work

The patch that was proposed and committed to fix this bug breaks the changes implemented previously to fix #1681904: Ability to configure a url to redirect to in site configuration.. As it stands, redirections to anything other than the main URI do not work in Apache.

lavamind’s picture

Priority: Major » Normal
Status: Needs work » Closed (fixed)

Reverting changes to this issue, I just noticed #2189687: Redirect to site-alias not working had already been created.

helmo’s picture

Status: Closed (fixed) » Active

@lavamind: Thanks for hinting on this.

@logaritmisk: You were probably missing the db update from: #2010064: Extra update hook to fix hosting_site_alias table content

I think I'll revert the commit from #3.

helmo’s picture

Status: Active » Closed (works as designed)

#3 reverted in both 7.x-3.x and 6.x-2.x

  • Commit 61bb866 on 7.x-3.x, dev-helmo-3.x by helmo:
    Revert "fix redirection for non-ssl hosts, issue #2148671 by logaritmisk...
  • Commit abc9ac9 on 6.x-2.x, 7.x-3.x, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    fix redirection for non-ssl hosts, issue #2148671 by logaritmisk
    

  • helmo committed 61bb866 on
    Revert "fix redirection for non-ssl hosts, issue #2148671 by logaritmisk...
  • anarcat committed abc9ac9 on
    fix redirection for non-ssl hosts, issue #2148671 by logaritmisk
    

  • helmo committed 807f076 on 7.x-3.x-1966886-context-to-entity
    Revert "fix redirection for non-ssl hosts, issue #2148671 by logaritmisk...
  • anarcat committed abc9ac9 on 7.x-3.x-1966886-context-to-entity
    fix redirection for non-ssl hosts, issue #2148671 by logaritmisk
    

  • helmo committed 807f076 on 6.x-2.x-1995506-profile-option
    Revert "fix redirection for non-ssl hosts, issue #2148671 by logaritmisk...
  • anarcat committed abc9ac9 on 6.x-2.x-1995506-profile-option
    fix redirection for non-ssl hosts, issue #2148671 by logaritmisk