Closed (fixed)
Project:
Hostmaster (Aegir)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2012 at 23:43 UTC
Updated:
30 May 2014 at 10:04 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
anarcat commentedBefore this is implemented, I would like to see this get in: #815190: Allow for both redirects and aliases.
Comment #2
anarcat commentedOh, and this will not hit 1.x.
Comment #2.0
steven jones commentedUpdated issue summary.
Comment #3
jon pughI've rebuilt the site alias form to use single textfields, with a "Add More" Ajax button, and added a select list to choose the "redirection target".
I realized that I could use the {hosting_site_alias}.redirection column to store the desired target URI.
The attached patches includes an update hook to change the schema of redirect column to varchar, and handles sites.php, and the vhost file.
It works with the automatic domains as well.
I built this on 1.x to start, but if this has potential to get in, will rewrite it to work with 2.x. I am not sure why this feature has to wait for #815190: Allow for both redirects and aliases
Thoughts?
Comment #4
jon pughMarking for 6.x-1.x-dev for now.
Comment #5
anarcat commentedPlease mark patched issues as needs review!
Comment #6
anarcat commentedI like this. The interface is better and is a good way to move forward towards #815190: Allow for both redirects and aliases.. We'd just need a "redirect" flag per alias then...
Please port to 2.x, this will not land in 1.x. Thanks for the great work!
Comment #7
helmo commentedI've spent some time on this. Testen on 6.x-2.x
* style clean up
It needs more attention, but here's an intermediate result as I'm out of time today.
Comment #8
anarcat commentedPushed as 191766c, thanks.
Comment #9
omega8cc commentedWhen "Generate www.domain.com alias automatically" and "Generate domain.com alias automatically" options are enabled, and the main site name is foo.com, it allows you to choose www.foo.com as a "Redirection Target", while in fact in the vhost foo.com is the target still.
Comment #10
steven jones commentedThere's another serious issue with what's been committed here too. The update functions depend on the hook_schema implementation so the update functions are not fixed. We need to pull the portion of the hook_schema we want out, and put in the update function.
Comment #11
ergonlogicAlso, isn't the convention to call the function something like hosting_alias_update_620x() ?
Comment #12
helmo commented@Steven Jones: the patch here fixes that.
@ergonlogic: Yes that's the convention, but the older update hooks in that file had the same bad pattern. However I think we should still start doing it right from here one.
I'm not sure about the Nginx part, but it seems that we 'lost' the provision part of this patch. Here's a reroll.
The http/Provision/Config/Nginx/vhost.tpl.php core seems to only do redirects when $ssl_redirection is true.
Comment #13
anarcat commentedlet's see if those patches finish this off properly - my bad for both missing the provision patch and the weird schema anti-pattern.
thanks for the reroll helmo.
edit: sorry - i forgot to give attribution...
Comment #14
omega8cc commentedThis needs to be fixed also for Nginx config.
Comment #15
anarcat commentedAh right, sorry I missed that. :)
Comment #16
helmo commentedI saw a notice as the result of the redirect code.... fixed in http://drupalcode.org/project/hostmaster.git/commit/46e3498
Comment #17
anarcat commentedgood. anyone working on a fix for nginx though?
Comment #18
anarcat commentedi fixed it for nginx. we have found that there are weird checks in the code for apache which ergonlogic will remove and detail some more, so I am keeping this open for now.
Comment #19
anarcat commentedactually, scratch that, it still doesn't work. graah.
Comment #20
anarcat commentedokay, now this is done.
Comment #22
helmo commentedFor reference, I've posted a small follow-up: #2010064: Extra update hook to fix hosting_site_alias table content
Comment #22.0
helmo commentedUpdated issue summary.