Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occurences of http #2496

Open
BorghildSelle opened this issue Aug 29, 2024 · 15 comments
Open

Occurences of http #2496

BorghildSelle opened this issue Aug 29, 2024 · 15 comments
Assignees
Labels
📜 Run migration script This issue requires changes in schema or content which is done through script

Comments

@BorghildSelle
Copy link
Contributor

BorghildSelle commented Aug 29, 2024

  • Find links in sanity documents that has http. or uppercase, and give list to Mette.
  • Add warning on external link sanity component about using http or uppercase. should have https and lowercase
  • Make enquiry to HCL in ServiceNow and Radix if the 308 redirect from http to https can be a 301 instead?

5 SEO benefits of 301 HTTP to HTTPS redirect:
Clear migration that helps Google understand all old URLs moved to new ones.
Google trusts a 301 migration as it sees it as one big relocation from HTTP to HTTPS.
Google perceives it as a normal generic site move and rankings aren’t negatively impacted.
HTTPS websites perform better on Google since they are beneficial to users by providing extra security.
301 redirects ensure a proper indexation of your website by Google.

@BorghildSelle
Copy link
Contributor Author

Task for :
Add warning on external link sanity component about using http or uppercase. should have https and lowercase
is done in connected PR #2503

@padms
Copy link
Contributor

padms commented Sep 23, 2024

@meols We have added a check for external link field, if http:// is used, to avoid additional redirect to https://

Also, for existing external urls, we will run a script to replace http:// with https://

@meols
Copy link
Collaborator

meols commented Sep 24, 2024

Thanks @padms - I like this way of solving it, but currently there are some issues

  • For external links in the text block component the warning is yellow (I like the red warning 😉)
  • It looks like there is a check for external link even if it is the internal link that is in use, so internal links give a red warning related to external link
  • When I change to https and lower case I still get a red warning

image.png

image.png

image.png

padms added a commit that referenced this issue Sep 27, 2024
padms added a commit that referenced this issue Sep 30, 2024
padms added a commit that referenced this issue Sep 30, 2024
@padms
Copy link
Contributor

padms commented Sep 30, 2024

@meols This is ready for a second review now.

  • Allowed a url to be case sensitive only for equinor.com and other satellite site urls, if its external it allows ( in cases where it might be case sensitive)
  • Fixed the warning to error
  • Fixed the bug with validation.

@meols
Copy link
Collaborator

meols commented Oct 14, 2024

Thanks @padms - is it possible to give some hints to editors on what they need to fix?
In this case/screenshot it actually took me a while to see that there were capital letters included in the url (which I didn't understand from the error message)
image.png

Not sure what you mean in the first bullet. Can or can't an external url (not equinor.com or satellite sites) have capital letters in the url for external link.

@meols
Copy link
Collaborator

meols commented Oct 15, 2024

@padms - also an additional question to confirm - will doing this change mean that we will have to manually rewrite the urls that currently are http or including capital letters to be able to edit and republish a page? E.g. YouTube links I assume and hope that we can just copy/paste.

padms added a commit that referenced this issue Oct 15, 2024
@padms
Copy link
Contributor

padms commented Oct 15, 2024

@meols We have a script that changes all the urls or( values ) that start with http: and replace it with https:// , no manual editing needed.

Fixed the error with the validation, should be working now.
Regarding the first bullet, since we want all equinor.com and satellite urls strictly have lower case letters, I made the lowercase check in the url for our sites alone, not for the external websites (like https://docmap.equinor.com ) which might have uppercase letters in their url..

@meols
Copy link
Collaborator

meols commented Oct 15, 2024

@padms - the script from http to https I understand. But when it comes to uppercase and lowercase letters in urls, I am more hesitant if we should change it and wonder what will happen in the future (after implementing this) - both for existing external urls and new ones we add that are copied from their "original place" and used containing both uppercase and lowercase letters. Editors will probably use the links as they are received from stakeholders (copy/paste). Will these external urls then give an error message editors will struggle to understand and need to be manually edited to only contain lowercase letters - as I did for the last link on this page (with real examples).
image.png

image.png

@padms
Copy link
Contributor

padms commented Oct 16, 2024

@meols This error related to magazine page with tags is fixed now..

What has been done:

@meols
Copy link
Collaborator

meols commented Oct 21, 2024

@padms - I'm still not sure about the upper/lower case issue. How critical is it to impplement that? As far as I remember it is related to a few short urls to avoid a redirect chain redirecting from uppercase to lowercase.
Could we rather just remove the redirect? Wouldn't any browser accept both lowercase and uppercase, so that we wouldn't need a redirect to handle it?

@padms
Copy link
Contributor

padms commented Oct 21, 2024

@meols Both urls would be accepted with no doubt. Found this on google

For SEO purposes, it's generally recommended to use lowercase letters in URLs because it avoids confusion and ensures consistency. Different capitalizations can lead to duplicate content issues, which might impact search engine rankings.

@padms
Copy link
Contributor

padms commented Oct 21, 2024

@meols The error message "Equinor URLs should contain lower case letter only" appears for all equinor.com and satellite sites urls when the contain uppercase letters
image.png

Urls like "https://www.equinor.com/magazine?tag=Our+energy+solutions" is allowed, as upper case letter after "?" is allowed and no redirect happens in such case.

Other websites like "docmap.equinor.com" are treated as external websites and uppercase validation is not done.

@meols
Copy link
Collaborator

meols commented Oct 21, 2024

Thanks @padms - if you recommend to do this it's fine with me. One question to the error message where we get two messages for one error (http); could we remove the first one - "Does not match...." An editor (me included) wouldn't know what that one means.
image.png

@padms
Copy link
Contributor

padms commented Oct 28, 2024

@meols I gave a fix to remove the extra error which is another way of saying "http is not allowed" :P

@meols
Copy link
Collaborator

meols commented Nov 4, 2024

Thanks @padms - approved 👍

padms added a commit that referenced this issue Nov 8, 2024
* 🎨 add warning for http and not valid slug

* 🐛 Refactor after comments #2496

* 🚨 Lint #2496

* 💚 🐛 Fix import bug #2496

* 🐛 Fix error with validation #2496

* 🐛 Check lowercase excluding queryparam #2496

* 🐛 Allow http to avoid error msg that confuses #2496

---------

Co-authored-by: Padmaja <[email protected]>
@padms padms added the 📜 Run migration script This issue requires changes in schema or content which is done through script label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📜 Run migration script This issue requires changes in schema or content which is done through script
Projects
None yet
Development

No branches or pull requests

4 participants