Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Rather than providing a text area for aliases, then a check-box to turn these aliases into redirects, why not provide two text areas - one for aliases and one for redirects? We have many situations where we would like both. Not 100% sure how widely applicable our Aegir use-cases are, but I suspect they are fairly mainstream.
Note from the Aegir maintainers:
This issue overlaps with:
Comments
Comment #1
realityloop+1 I was asking mig5 about this just the other day, and this is exactly what I had in mind :)
Comment #2
anarcat CreditAttribution: anarcat commentedTo answer your question ("why not?"): because it was easier that way. :)
I do not object making that change, but do keep in mind the current UI is very easy to use, and adding that feature will make it much more complicated, not sure it's worth the tradeoff unless it's really done right...
I guess having two textareas is simple enough. :)
Comment #3
obrienmd CreditAttribution: obrienmd commentedStrangely, the users I've talked to are confused by the current setup (maybe because they are more technically-minded)... The idea of an "either/or" doesn't make sense to them when aliases and redirects are two different things. Typical case: A user wants a few alias subdomains so multiple http requests can be made for css, js, etc, but redirects from others so that all actual user-viewed pages are on a consistent subdomain (for SEO). Does that make any sense?
Comment #4
anarcat CreditAttribution: anarcat commentedThe more I look at this form, the more I feel you guys are right and having two boxes just makes sense. I would welcome a patch.
Comment #5
obrienmd CreditAttribution: obrienmd commentedI'm happy to patch the form / variable storage... but w/ my IT chops, I'm not quite sure how to attach the backend. If anyone wants to build off my work on the UI, let me know and I'll work something up!
Comment #6
obrienmd CreditAttribution: obrienmd commentedOK, I'm going to give this a shot. Off to #aegir to ask for mentoring :)
Comment #7
obrienmd CreditAttribution: obrienmd commentedMoving this over to hostmaster. Here's my current working theory on an approach:
I don't think changing the database structure is the best approach, so i'm thinking to remove the checkbox, add a textarea for redirects in its place, the change the alias add/update logic to run the existing INSERT stuff for each $node->aliases and $node->redirects, but hardcode redirection column to 0 for aliases and 1 for redirects.
In theory, this _should_ maintain compatibility with everything else, as long as the provision stuff can handle both redirects and aliases on a single site.
I'd welcome thoughts in the next few hours before I start hacking away at this!
Comment #8
anarcat CreditAttribution: anarcat commentedThis is exactly what needs to happen.
Comment #9
obrienmd CreditAttribution: obrienmd commentedWorked on this a bit over the weekend, but it might be a while... This is over my head and I'm learning a lot!
One thing that might be a showstopper (and I'm going from memory here, don't have the code in front of me) is that the drush code seems to hand the entire site off with one toggle for redirect or aliased... So there may have to be some patching on the provision side of things as well.
I'm also struggling with how to handle the automated www, non-www, and subdomain stuff in the context of this change. The www/non-www stuff could just be radio buttons (auto www: none, aliased, redirected.... auto non-www: none, aliased, redirected), but not quite sure how to handle the subdomain stuff.
Any input would be much appreciated!
Comment #10
anarcat CreditAttribution: anarcat commentedMy gut feeling is that the automatic aliases should have the same UI as the site aliases. That is, we would have one hosting-wide setting for "automatic redirects" and another for "automatic aliases".
As for the IPC between hosting and provision, I expected that to change, to be honest, so that's not a big problem. :)
Comment #11
jgabor CreditAttribution: jgabor commentedCould this potentially solve the problem I've discussed with myself here?
Comment #12
obrienmd CreditAttribution: obrienmd commentedjgabor: Even as it stands, the redirect feature will solve your problem (as long as you don't also want aliases). If I ever get my hacking to work, you'll have the ability to do both :)
Comment #13
Robin Millette CreditAttribution: Robin Millette commentedsubbing
Comment #14
Steven Jones CreditAttribution: Steven Jones commentedComment #15
omega8cc CreditAttribution: omega8cc commented@obrienmd - any progress on this feature?
Comment #16
obrienmd CreditAttribution: obrienmd commented@omega8cc - unfortunately, haven't got back to hacking on this... it's a much-needed feature, I'm sure I'll try again this year if it doesn't show up, once the project load comes down in a few months
Comment #17
anarcat CreditAttribution: anarcat commentedNote that this overlaps with #1681904: Ability to configure a url to redirect to in site configuration., but i think this should be done first.
Comment #17.0
Steven Jones CreditAttribution: Steven Jones commentedUpdated issue summary.
Comment #18
matglas86 CreditAttribution: matglas86 commentedMaybe you guys are helped with a use-case of mine that is related to this.
Redirect
When I setup a site in Aegir it gets its site name, e.g. example.com. This will be the tld. Then I want my site visitors only go to the www. version of my site. To do this now I need to set my site name to www.example.com and add example.com as a alias.
Subdomain
Next to that, when someone enters through demo.example.com it should be catched too and be redirected to www.example.com.
Alias
For my cdn purpose I want an alias that serves my css/images files etc. This will be available on cdn.example.com. Now we need to be sure that it does not redirect to www.example.com because that defeats the purpose.
I hope this helps in getting closer to the solution.
Comment #19
obrienmd CreditAttribution: obrienmd commented#18: That's the use case we're all talking about. Basically, one text area for Redirect and another for Subdomain + Alias (which are the same).
Comment #20
omega8cc CreditAttribution: omega8cc commented@matglas86 note that you can get separate vhost created for fake (local) CDN support with this module: http://drupal.org/project/provision_cdn - so you have at least last item on your list fixed. The first two need separate aliases and redirects feature. I think I will work on this next month (Nov).
Comment #21
d.sibaud CreditAttribution: d.sibaud commentedHello, this would be an awesome feature (the one to separate aliases from redirects), there is any progress on this?
Comment #21.0
d.sibaud CreditAttribution: d.sibaud commentedUpdated issue summary.
Comment #22
ergonlogicNew features need to be implemented in Aegir 3.x, then we can consider back-porting to Aegir 2.x.
Comment #23
samuelsov CreditAttribution: samuelsov commentedAs mentionned here, it is possible to do all sort of customization in the vhost in a aegir context.
For example, if you need to have several distinct domains for the same drupal instance but want one domain to be redirected to the main domain, you could set the
Redirect all domain aliases to: No redirection
in aegir and add the single redirection in a module with a file my_module.drush.inc that implement hook_provision_apache_vhost_config like that :The module can be created in /var/aegir/.drush/ for example.
Still, it can be difficult to maintain and errors are possible, so i would rather do it within aegir.
But the UI will not be able to handle every possible cases.