sunnah-com / website

The sunnah.com website
160 stars 53 forks source link

Permalink canon #58

Open fsid opened 3 years ago

fsid commented 3 years ago

Assalaam u Alaikum,

Since 8fe0daa, a user may jump directly to a hadith if they know the reference number, using the following structure: _sunnah.com/collectionslug:###

For example, to jump to Sahih Bukhari 2011, go to sunnah.com/bukhari:2011

This makes verification of ahadith quick, and is generally a more straight-forward link for browsing ahadith.

Limitations: Works with verified books in our DB only

Examples: https://sunnah.com/bukhari:1000 (generic case) https://sunnah.com/muslim:844b (has a space in the hadith number) https://sunnah.com/nasai:687 (Should not work since that book is not verified) https://sunnah.com/bukhari:273 (has commas)

Problem: With 2 different permalinks for the same hadith, we have an issue of duplicate pages and link juice being potentially diluted. So at the very least we must choose one canonical permalink structure.

Since the site is commonly referenced, it is important to keep previously used permalinks accessible as well. This can be solved by using either of the solutions mentioned below, no matter which permalink structure is chosen as canon. The chosen structure will also be used while browsing the website.

Possible solutions:

  1. Utilize rel="canonical" HTML tag
  2. 301 redirects to the chosen new standard (ruled out, unless there's a strong case)

Currently, we like the rel=conanical solution. It is honored by both Search Engines and common Social Media platforms. That means leaving both links accessible but the alternative method will have the cononical tag added.

Any feedback on the following 2 questions specially is welcome:

  1. Is there a case against using colon (:) in permalinks?
  2. Which permalink structure should be canon?
naushervan commented 3 years ago

Is there a case against using colon (:) in permalinks?

I think that the colon permalink is the way to go as we want to accommodate the other /book-number/hadith-number permalink structure.

Which permalink structure should be canon?

The colon permalink structure should be canon as I find that Ḥadīth number to be the Ḥadīth reference found in books. I have never seen the book-number/hadith-number reference in books.

The only potential case against the colon could be that it may negatively affect SEO. However, I haven't studied SEO so I cannot really comment on it.

Here are some relevant pages: https://www.seroundtable.com/google-avoid-using-special-characters-in-urls-21334.html https://blog.seoprofiler.com/google-avoid-commas-semicolons-spaces-special-characters-urls/

In case it is found that a colon is not good for SEO, then you may replace it with a hyphen (-). The hyphen is the most common, recommended word separator in URLs (an example URL using hyphens is https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers). And Stack Exchange which uses hyphens does really well in search results.

On sunnah.com, the permalink would look like https://sunnah.com/bukhari-1000