I’m working on a web project and trying to figure out the best approach for implementing clean URLs. You know, those nice-looking URLs without query parameters and file extensions. I wonder if this should be managed by the server or if it’s something for the client to handle. Some believe it’s a backend issue since the server routes requests properly, while others think modern frontend frameworks can manage it well. What are your thoughts? Do you set up clean URLs through your server settings and backend routing, or do you let your frontend framework take care of it? I’d really appreciate your advice on this!
interesting topic! what frontend framework are you using? your setup really affects this decision. also, do you have seo requirements or is this an internal tool? context matters a lot for picking the right approach.
I’ve built several production apps, and hybrid approaches work best. You need server-side routing for clean URLs and reliable initial requests, plus client-side routing so SPAs can navigate without full page reloads while keeping those clean URLs. It depends on what you’re building. Traditional multi-page apps? Just use server-side routing through URL rewriting or your framework - that’s enough. But SPAs need both: server-side config for direct URL access and refreshes, and client-side routing for smooth navigation. I usually set up the server to serve the main app file for all routes, then let the frontend router decide what content to show based on the URL path.
yea, totally get that! server-side is super important for making sure search engines can crawl your site better and users can bookmark stuff without issues. i had a similar prob with my SPA, and it was a mess when google wouldn’t index it. definitely need to have a good fallback setup.