Clarifying behaviour of "URL prefix redirect"

Created on 18 December 2022, about 2 years ago
Updated 5 February 2023, almost 2 years ago

Problem/Motivation

The configuration page, under "URL prefix redirect", offers a toggle between two options:

  • Without WWW prefix
  • With WWW prefix

With the additional help text:

Users will be redirected corresponding to the selected option.
Make sure your site is accessible for the option selected.

Some potential new users of the module (as me today) may have problems understanding what those two options do, and which one to choose.

For example does "Without WWW prefix" mean that the redirect

Proposed resolution

If you can clarify, I am happy to suggest adjusted wording, and to also translate the configuration form into French.

💬 Support request
Status

Fixed

Version

2.0

Component

User interface

Created by

🇫🇷France agaq

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇸🇪Sweden enzipher

    I had a quick look at the case issue, and the getHost() method is always returning a lowercase string (as per RFC 952/2181), so there will never be a case comparison issue.

    Is there any particular reason why you cannot enable "Redirect to HTTPS" without also enabling URL prefix redirect?

    My initial thought was that you simple shouldn't use both, but I do agree that it should be up to the user to make that decision as there might be edge cases where it's needed.

    Apart from the text changes there are some changes to logic as well, which needs to be done with care to ensure backwards compatibility.

    Otherwise your assumptions are correct regarding redirects. With the addition that forum.mydomain.com would actually get the www prefix if enabled. I've added a separate issue for that bug ( 🐛 The www prefix is added to sub-domains Fixed ).

    Thanks,

  • 🇸🇪Sweden enzipher

    I did some updates on my local. Feel free to review the attached image and let me know if it makes sense to you.

  • 🇫🇷France agaq

    Yes, it does make sense to me.

    Just a typo in the comment for the Domain prefix / No redirect option: it should be "are accessible" instead of "is accessible"

    My suggestion for translation in French below, under the English.

    ===

    Text in English:

    Domain prefix

    (_) No redirect
    Both mydomain.com and www.mydomain.com are accessible. Only use this option if you are certain it is needed.

    (_) Remove WWW prefix
    Redirect www.mydomain.com to mydomain.com.

    (_) Add WWW prefix
    Redirect mydomain.com to www.mydomain.com.

    HTTP Secure (HTTPS) redirect

    (_) No redirect
    The site remains accessible via HTTP, as well as via HTTPS (if enabled).

    (_) Redirect to HTTPS
    The site becomes accessible only via HTTPS. All HTTP requests are redirected to HTTPS.
    ATTENTION: if you choose this option, make sure your site is accessible by HTTPS, and that your SSL certificate is valid.
    For more information, see https://www.drupal.org/https-information .

    Text in French:

    Préfixe du domaine

    (_) Pas de redirection
    mydomain.com et www.mydomain.com sont tous deux accessibles. N'utilisez cette option que si vous êtes certain qu'elle est nécessaire.

    (_) Supprimer le préfixe WWW
    Rediriger www.mydomain.com vers mydomain.com.

    (_) Ajouter le préfixe WWW
    Rediriger mydomain.com vers www.mydomain.com.

    Redirection HTTP Secure (HTTPS)

    (_) Pas de redirection
    Le site reste accessible via HTTP, ainsi que via HTTPS (si activé).

    (_) Redirection vers HTTPS
    Le site devient accessible uniquement via HTTPS. Toutes les requêtes HTTP sont redirigées vers HTTPS.
    ATTENTION : si vous choisissez cette option, assurez-vous que votre site est accessible par HTTPS, et que votre certificat SSL est valide.
    Pour plus d'informations, voir https://www.drupal.org/https-information .

  • 🇸🇪Sweden enzipher

    Great, thanks!

    I'll implement this along with the French translation. Also thanks for catching the typo.

    • enzipher committed 3964a7ad on 2.x
      Issue #3327905 by enzipher, agaq: Clarifying behaviour of "URL prefix...
    • enzipher committed c0774f58 on 2.x
      Issue #3327905 by enzipher, agaq: Add 'No redirect' option for 'Domain...
  • Status changed to Fixed almost 2 years ago
  • 🇸🇪Sweden enzipher

    Hey. So I've been doing a bit of maintenance and incorporated the updated texts. It's all available in the 2.1.0 release.

    Now for translations, the correct way of doing it is to go through https://localize.drupal.org. I have not done this myself, so I'm not exactly sure what the exact procedure is, but I would suggest going to that site and read up on the docs. I know it involves signing up for the language specific translation team though, in your case that would be https://localize.drupal.org/translate/languages/fr.

    The release to translate strings for would be version 2.1.0.
    https://localize.drupal.org/translate/languages/fr/translate?project=htt...

    I will mark this ticket as fixed as there's nothing more to do here. I'm not sure if I can be of any more help for the translations, but feel free to contact me if there's anything you believe I can assist with, or if appropriate, open a new ticket.

    Thanks for your help!

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

Production build 0.71.5 2024