What Is URL Rewriting? Definition and 5 Best Practices for Web Professionals

Posted on December 3, 2024 | Updated on December 3, 2024

Experienced web designers understand the importance of a good domain name. However, relying on automatically generated URLs for each page on a website can limit the benefits of a well-chosen and thought-out domain. A practice called URL rewriting can help designers avoid that outcome.

What Is URL Rewriting?

URL rewriting is the process of turning long, complex URLs into simple, easy-to-read alternatives. The destination remains the same, but what users type into or see in the address bar looks much more concise and organized.

As you add new pages to your website, the code or hosting service you use will automatically generate a unique URL for the content. While that streamlines development, these auto-generated addresses are typically long and difficult to read.

Consider how benign URLs have an average length of 44.28 characters and contain 8.64 special characters, but phishing URLs — which are typically auto-generated — are 63.14 characters long on average, with almost 14 special characters. That doesn’t mean every long web address is malicious, but it shows how automation trends toward complexity.

URL rewriting puts control back into your hands. You can turn a lengthy, nonsensical string of numbers and abbreviations into a few descriptive keywords.

Benefits of URL Rewriting

Reformatting URLs into a simpler, more readable format has several advantages. These benefits affect both your current audience and the potential user base you can reach in the future.

Better UX

The most obvious advantage of URL rewriting is that it improves your user experience (UX). A 60-character address full of symbols and numbers is hard to recognize and even harder to remember. One consisting of just a few words looks better and is easy to recall if users need to.

Readability translates into ease of navigation. It’s easy to see where you are on a page when the URL describes exactly what you’re looking at and what larger section the page is under. Longer, complicated addresses hinder navigation because it’s hard to see the full text, especially on mobile, which accounts for 70% of internet traffic today.

Improved SEO

URL rewriting can improve your search engine optimization (SEO) for similar reasons. When something becomes easier to read for humans, it also becomes easier for web crawlers to recognize. Search engines like Google can see keywords in your URL, helping it associate your page with the queries you’re trying to target.

You can see this for yourself by searching for any term. Hover your cursor over the top results, and you’ll likely notice that all of them have the keywords you searched for in the URL. There’s no guarantee that will happen when you rely on auto-generated addresses, but URL rewriting lets you ensure your address contains those searchable terms. 

A Google search for "URL rewriting"
Notice how all of the top results’ URLs contain the keyphrase “URL rewriting” or “URL Rewrite”

Easier Reorganization

Rewriting your URLs also makes it easier to reorganize your website in the future. Periodic design refreshes are important, as trends change and Google releases several core updates a year, requiring adaptation to remain relevant. However, maintaining navigation and user-friendliness during a reorganization can be tricky with conventional addresses.

When you rewrite your URLs alongside a website redesign, you can reflect any important changes in each page’s address. That may include showing the new category name for a specific post or including a new subsection you’ve refiled it under. Whatever the specifics, users can see the reorganization in the URL itself, making it easier to learn the new system and find related content.

URL Rewriting Best Practices

Now that it’s clear why you should rewrite URLs, you should be aware of a few best practices. Following these five steps will help you make the most out of your web addresses.

1. Ensure Readability

Above all else, your URLs should be easy to read. Long, complicated addresses should be the first ones you change in your URL rewriting strategy, and making them clear and concise should be your primary goal. Remember to keep them short — while browsers can support over 2,000 characters in an address bar, URLs at or under 75 characters are easier to see in their entirety.

A good rule of thumb is to use keywords and not much else. Your domain name, category name and target keyphrase for a specific page is all you need to tell users what to expect. Anything beyond that can be distracting, which is bad for UX and SEO.

A woman designing a website on a laptop
Just as your website’s design must use consistent branding, so must your URLs

2. Be Consistent

As with other aspects of your web design, you also want to be consistent in your formatting. Don’t rewrite some landing pages’ URLs but leave blog posts with their auto-generated addresses. Similarly, you should apply the same organizational cues to anything you rewrite.

Categories are a good example. You may organize content into multiple subcategories, but you should ideally only include one primary section before the page name in your URL. Either the broadest or most specific will work, but the important thing is that you go the same route for every page. Don’t include the overall category in one URL but the most granular one in another.

3. Use Short Redirect Chains

You may already have a few indexed and linked pages that perform well despite a suboptimal URL. Consequently, you’ll want to redirect users going to those old addresses to the new ones to avoid confusion and maintain accessibility for your existing audience. You can do this through 301 redirects, but remember to keep the redirect chain short.

Sending users from one address to another multiple times before arriving at the new, optimized URL will be slow and aggravating for the user. Instead, you should use a single redirect, linking directly to the new URL. You can use plugins like Redirection to streamline the process and avoid errors.

4. Review Backlinks

Even with redirects, URL rewriting may impact your backlinks. You can counteract this by reaching out to website owners that you know have linked to you and providing them with the new URL to update in their links.

It’s also a good idea to test any old links you’ve redirected to see if the redirect works. That way, you can address the problem before it causes much friction with your audience.

5. Prepare for Disruption and Review the Impact

Finally, you should be aware the a larger URL rewriting strategy may temporarily disrupt your traffic and similar key metrics. Understanding this ahead of time will help you make sense of the change.

Even so, you should watch your site’s performance closely after the rewriting. Monitor which pages saw the largest changes, how large the disruption was and if anything improved as a result of the rewrites. Insights from this review can inform better URL optimization in the future.

Get More Out of Your URLs

The way your URLs look may seem insignificant at first, but it has a huge impact on accessibility and SEO. Once you understand that, you can use URL rewriting to your advantage. Optimize your addresses today to give your site an extra boost.

About The Author

Coraline (Cora) Steiner is the Senior Editor of Designerly Magazine, as well as a freelance developer. Coraline particularly enjoys discussing the tech side of design, including IoT and web hosting topics. In her free time, Coraline enjoys creating digital art and is an amateur photographer.

Leave a Comment