There seems to be an issue with the code that generates SSL virtual hosts (via the SSL feature), when it's combined with the Site Aliases feature and it's auto-redirect capability.
I encountered the problem with the following setup:
- I have the SSL and Site Alias features enabled.
- I have a site that is set up on it's primary domain: example.com.
- The site has an alias of: www.example.com
- The alias features is configured to automatically redirect to the www.example.com alias.
When the site is verified, the SSL virtual host that is created sets up a redirect, but it incorrectly redirects to the primary domain of the site, not the "www" alias. Meanwhile, in the normal virtual host (port 80), it correctly redirects to the "www" alias.
Here are the rewrite rules that were just generated in my test:
(in the port 443 virtual host:)
RewriteCond %{HTTP_HOST} !^example.com$ [NC]
RewriteRule ^/*(.*)$ https://example.com/$1 [NE,L,R=301]
(in the port 80 virtual host:)
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC]
RewriteRule ^/*(.*)$ http://www.example.com/$1 [NE,L,R=301]
Comment | File | Size | Author |
---|---|---|---|
#3 | provision_vhost_ssl_alias-2084963-3.patch | 818 bytes | m.stenta |
Comments
Comment #1
anarcat CreditAttribution: anarcat commentedthis looks like a regression from 1.x
Comment #2
anarcat CreditAttribution: anarcat commentedactually, it looks like the problem is not SSL-specific, can you verify if this problem is the same as #2089591: Setting a Redirection Target in the site alias seciton other than the original site takes you to install.php?
Comment #3
m.stentaI dug into this and figured out what's causing the issue. The vhost_ssl.tpl.php file is using the wrong URI variable in the redirect. Attached is a patch that fixes the issue.
I don't think this is the same issue as #2089591: Setting a Redirection Target in the site alias seciton other than the original site takes you to install.php. It's related, but I suspect it is something else. The code in the none-SSL vhost template that handles redirects looks a little funky to me, so I'm going to check that out. Waiting to hear back from SocialNicheGuru in the other issue thread...
I think this one can be fixed now.
Comment #4
anarcat CreditAttribution: anarcat commentedso it seems that #1681904: Ability to configure a url to redirect to in site configuration. was actually missing SSL support, so this patch is required! committed, thanks.
Comment #5
chertzogClosing since it was committed.