0

I've been asked to create a few different folders with the same name but with different capitalizations. The idea behind this is to allow for errors in capitalization when someone types in a specific url. They want to do something like this:

www.website.com/youtube www.website.com/Youtube www.website.com/youTube www.website.com/YouTube

I believe this is bad practice for many reasons, mainly that it seems confusing and unnecessary and any updates to these pages will have to be done 4 times over. I've also noticed that VSCode won't let me create these directories from within the editor and my computer, a windows machine, won't let me do it from within the file manager either.

I've seen that this can create a problem with git as it won't recognize the files as separate files regardless of capitalization.

So really my questions are:

1.) Is there a way to do this?

2.) If so, is it a bad practice?

3.) If it's a bad practice, why?

I'd like to do it for them if possible, but not if there are some unforeseen consequences that I'm not aware of. Any insight would be appreciated.

Thanks in advance.

edit: Just to be clear, we already have www.website.com/youtube but a few users have reported that their browser autocorrects the 'youtube' section of the url to have the Y or the T capitalized. From what I see now, to accomplish this we must do something on the server side, of which my knowledge is limited. All I know for sure is that it is a Linux server.

  • You should not have different files for the same purpose, 4x the chance of errors during changes. Depending on the system the site will run on you should just make the url's lowercase. For example look at https://stackoverflow.com/questions/2923658/convert-to-lowercase-in-a-mod-rewrite-rule – René Mar 21 '19 at 19:39
  • Thanks Rene. For clarification we already have www.website.com/youtube, but some users claim that their browser automatically capitalizes one ofthe letters in the 'youtube' part of the URL. This results in a 404. – Jacob Bryant Mar 21 '19 at 19:44

1 Answers1

-1

To start with, the sane solution would be redirect those routes to the proper one, which is not an uncommon task. I don't know what your infrastructure looks like to the ease of doing so is unknown.

1.) Is there a way to do this?

Assuming that your server is Linux/BSD/Using anything but a Windows NTFS filesystem, yes. You can have one folder as source of truth and create symlinks. Or again, you could make the routes case-insensitive on whatever server you're using.

2.) If so, is it a bad practice?

Cloning the same information and making the same updates repeatedly is terrible practice. Making symlinks on the server is slightly less bad but still pretty bad practice, as that's cluttering up your directory tree with unnecessary nonsense.

3.) If it's a bad practice, why?

The idea isn't bad practice, you can make case-insensitive routes on most modern server configurations. The provided suggestions are pretty bad. But without knowing what your stack looks like, we can't provide much more information on how to do it.

Mark
  • 694
  • 5
  • 15
  • Thanks for the insight Mark I appreciate it. I know that our server is Linux but I don't have much more knowledge than that. I figured I would just create 4 folders with the same name but varying capitalization and it would be done. Apparently it is more complicated than that. – Jacob Bryant Mar 21 '19 at 19:52