A URL is the web address of a page. A friendly, readable URL helps the visitor and the search engine understand what the page is about, and it also appears in the results. In a store it is worth setting a sensible address structure and - even more importantly - keeping it stable. Below is how a URL should look, how long it should be, what to watch for when changing it, and how to handle it in Magento.
What a good URL should look like
- Short and descriptive: with the main keyword, so the address itself reveals what the page is.
- Hyphens between words: separate words with hyphens (-), not underscores or spaces.
- Lowercase only: on some servers addresses are case-sensitive, so lowercase prevents 404 errors and duplicates.
- No special characters or parameters: no diacritics, special symbols, session IDs, or unnecessary parameters.
- Shallow structure: at most 3 to 4 levels of depth; overly long paths dilute authority and confuse.
Include the keyword, but without stuffing - the URL should be readable to a human.
Interesting: URL length
URL length is one of the more researched details. A large-scale analysis (11.8 million results) showed that URLs in position 1 are on average about 9 characters shorter than those in position 10, and the average URL among the top ten measures about 66 characters. Shorter URLs also have a higher click-through rate, and URLs that contain the searched keyword attract up to about 45 percent more clicks than those without it.
To be fair, it should be added: Google explicitly says that the length of a URL and the number of slashes do not directly affect ranking - the link between short URLs and better ranking comes mainly from other factors. Length is therefore not a lever worth obsessing over; the goal is simple - a short, descriptive address with the keyword (recommended up to about 60 characters or 3 to 5 words) for readability, clicks, and a nicer display in the results.
An example: instead of store.com/products/category-5/subcategory/product-id-12345?ref=menu, prefer store.com/running-shoes-nike-air.html.
Stability is key
Once a URL ranks and gathers links, do not change it without need. If you must change it, always set a permanent redirect (301) from the old to the new address - this preserves link equity and avoids broken links and 404 errors. Changing a URL without a redirect is one of the most common sources of lost traffic.
How to handle it in Magento
Every product and category has a url key field, from which Magento builds the address (usually with a .html suffix). Two settings matter here:
- "Create Permanent Redirect for URLs if URL Key Changed" should be Yes: this way Magento automatically creates a 301 redirect from the old address whenever a url key changes - turn this on without fail.
- "Use Categories Path for Product URLs": this adds the category path to the product address (store.com/category/product.html). It lengthens addresses and makes the product reachable via several paths - a source of duplicate addresses. It is often better to have it off, so the product has a single, stable address regardless of the category.
Addresses are managed by the URL rewrites module; after major changes you regenerate them if needed.
How to measure whether it is tidy
With a crawler check whether there are any overly long, duplicate, uppercase, or parameter addresses and fix them. After every url key change, verify that the 301 redirect really exists. The goal is simple: short, readable, stable addresses with one path to each page.
