: Should I give up on using URL slugs if they are too long? My website is a website for sharing studying materials between students for the Israeli "Bagrut" exam. I hate URLs that are built
My website is a website for sharing studying materials between students for the Israeli "Bagrut" exam.
I hate URLs that are built from numbers that don't mean anything so I've been using URL slugs.
My website has already organized each subject into a hierarchy of:
subject > cateogry > subcategory
So naturally the URL hierarchy is:
subject/category/subcategory/material
The material added by users is actually in Hebrew so the last one will have to be a number.
What I'm worried about is that the URLs are getting very very long; for example:
www.example.com/subject/history_a/nationalism-israel-other-nations/characteristics-nationalism-national-movements-europe-19th-century/12
They were even longer to begin with but I dropped some words to make them shorter.
should I give up? Is this even worth it?
More posts by @Tiffany637
2 Comments
Sorted by latest first Latest Oldest Best
You want to keep URLs as short and simple as you can. Short URLs are easier to write down on paper and easier to type in as well.
This URL...
www.example.com/subject/history_a/nationalism-israel-other-nations/characteristics-nationalism-national-movements-europe-19th-century/12
...is probably the 3rd longest URL I have ever seen.
The best thing to do is categorize more. Start with a domain name that best represents the exam such as:
www.bagrutexam.com
then you don't really need the word subject in the URL because that will be mentioned in the home page and it will be obvious in the other pages as you construct them.
Then decide on a major subject category which in your URL is history:
www.bagrutexam.com/history
Then if you want a subtopic, keep it short too:
www.bagrutexam.com/history/nationalism
Then maybe one more subtopic:
www.bagrutexam.com/history/nationalism/19th-century
Then a number identifying the exam itself:
www.bagrutexam.com/history/nationalism/19th-century/1
and for the second part:
www.bagrutexam.com/history/nationalism/19th-century/2
Try not to use more than two words between any two slashes in the URL or it will become very messy, and always choose the best words in the URLs that users will likely search for to reach the page.
Also, if you expect to have the URLs emailed or compatible with every device in the world regardless when it is made, then you should keep the URL length to under 80 characters.
Another disadvantage to long URLs is that too many characters will cause the server to produce its own errors. In apache, the maximum URL length is by default slightly under 8190 characters.
See: httpd.apache.org/docs/2.2/mod/core.html#limitrequestline
The main reason for using "URL slugs" is usability. Making the URL readable and easier to remember (and perhaps help click through rates in the SERPs).
However, as you fear, a long URL lessons usability. (If it's too long it's not going to show in the SERPs anyway.)
But how long is too long?
This could depend on the subject matter and the range of material on your site. If it's still useful to users and isn't causing problems then it's probably OK. However, you don't really want it to get much longer. Can you not shorten your subcategories?
characteristics-nationalism-national-movements-europe-19th-century
This seems very verbose. Don't think keywords (SEO). Think about your users.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.