Skip to content

Conversation

@JonDevOps
Copy link
Member

@JonDevOps JonDevOps commented Jan 24, 2021

first four lines deal with the removal of the .html extension in the url, the following four lines deals with the addition of the trailing slash and redirecting.

edit this

  • I have read w3Develops contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the production branch of production.
  • None of my changes are plagiarized from another source without proper attribution.
  • All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
  • My changes do not use shortened URLs or affiliate links.

Closes #XXXXX

 first four lines deal with the removal of the .html extension in the url, the following four lines deals with the addition of the trailing slash and redirecting.
@hannahpi
Copy link
Member

I'm not sure I completely understand this, would this always add a / to the end of the URL or only during certain conditions? I would think that you'd want to add / but only when with the following conditions:

  • The url does not end with a file extension
  • The url does not end with a /

Special considerations:

  • Make sure to ignore domain names (i.e. a request sent to w3develops.org should not be considered a file extension)
  • Make sure that dots(.) aren't going to be in any part of the api (such as a restful API) so if you have something like a get w3develops.org/users/some.user.with.a.dot but I think api calls wouldn't care whether or not there would be a trailing /.

I'm guessing this addresses all of this already but I'm not sure how these rules work exactly: what conditions are associated with which rules and such--are additional conditions applied to all the rules you have in the file? Are the conditions met when any one of the conditions are true (I'm guessing so--I don't think they could all be true).

@JonDevOps JonDevOps self-assigned this Feb 2, 2021
Copy link
Member

@hannahpi hannahpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. I'm a bit suspicious that it's doing more than what is needed. I think we can cross that bridge when/if we get to it though. If someone else wants to chime in feel free to!

@JonDevOps JonDevOps closed this Feb 5, 2021
@JonDevOps
Copy link
Member Author

I'm closing this as an unnecessary patch. @waterlgndx thank you for your input!

@JonDevOps JonDevOps deleted the JonDevOps-patch-1 branch February 5, 2021 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants