My URL paths are forced into lowercase

Briefly summarize the issues you have been experiencing.

I use netlify deploy --prod --dir=build
Inside that directory there’s a file called build/Foo/Bar/index.html and I want my users to get a 200 OK if they open https://domain.netlify.com/Foo/Bar
But what happens is that I get a 301 redirect to /foo/bar :frowning:

Please provide a link to your live site hosted on Netlify
Not yet.

What have you tried as far as troubleshooting goes? Do you have an idea what is causing the problem?
Contacted customer support. Mostly because I didn’t even know about this community.

Do you have any other information that is relevant, such as links to docs, libraries, or other resources?
I’m not using any fancy GitHub integration. Just the cli and my .html files on disk.

Switching everything to lower case is not an attractive option at the moment. It would break too many things.

1 Like

Hi Peter,

This is an intended feature of our platform from which you cannot opt out. We’ll serve any combination of case (e.g. FiLe.HtMl or file.html or FILE.HTML) correctly, though the mixed-case ones will be redirected to the “canonical” lowercase definition.

We found that most people deploy from a non-case-sensitive filesystem (windows/mac) and this was the best way to make things work as most folks intended.

Aside from the unwanted (1-time per browser) HTTP 301 redirect, which gets cached by the browser so it is not an “ongoing cost” for repeat visitors, is there any other problem with this in your workflow (e.g. your site won’t work due to it)?

Interesting. And thank you for the response.

Our use case is we’re potentially migrating from a web site where URLs come from slugs stored in a relational database. They are mixed case. And these URLs (thousands of them) have been indexed by Google so part of me gets nervous about breaking that.

My app is one of those React with react-router things and URLs work fine and it’s using pushState but if someone refreshes the page after having done some navigating around (with my mixed case URLs) the address bar will change.

I need to think about what this means in terms of how we look in the face of Google. You know, from a SEO perspective.

By the way, the functional effect to users is minimal since the 301 is fast and painless. And my code that uses the URL to figure out which XHR requests to make is agnostic.

Hi @peterbe, sounds like you already have a course of action to move forward. Let us know if you have any other questions.

1 Like

Yep. I don’t know how to “close” this topic.
Not going to deny that I’m a bit disappointed but I also understand the rationale from Netlify’s perspective.

Guys - just to say that we’ve had exactly the same problem. Netlify, I understand your motivation, but it’s a weird and uncomfortable thing to be doing this kind of stuff. Why not let your customers make decisions rather than make decisions for them?

3 Likes

Hello @mat01123, this post is resolved. If you are experiencing an issue or would like to file a feature request, I would recommend opening a separate post. Thanks!