Permalink / Best Practice

I’m going to establish permalinks on a website, and I’m wondering what agreements I must follow regarding their creation from the existing news table.

So far, we have provided the following rules / steps:

  • Create a dump file of my live database, configure locally
  • Add a new permalink column to my news_articles table using ALTER table ADD column slug VARCHAR(100)(not sure about the type or length of the data, suggestions?)
  • Update every row in my news_articles table to

the permalink column is replaced by default with the header after the header goes through some formatting:

Disclaimer: the titles are Russian Cyrillic, not English, so I don’t think I can get away with the easy replacement of the regular expression, if maybe I rely on the Unicode code ranges, except for me I’m not familiar with the Cyrillic range, so I'll do it manually replacements and rules that I have defined so far:

  • replace all spaces with an underscore
  • disable start / end commas and periods
  • remove all single / double quotes
  • delete all question marks
  • & becomes a Russian word for 'and'

I would appreciate any recommendations on my current strategy before I actually implemented them, as there are thousands of articles.

+3
source share
2

/

  • ( hypen , SO)
  • / ( / )
  • / ( , )
  • ( , , , "" ( /) % = ..)
  • & '' ( , ? url)

Update:
* ( , , )

, , , , url- slug urlencoded. slug, urlencode . .

, slug "permalink-slug:best-practices", urlencoded "permalink-slug%3Abest-practices", slug, /. , , urlencoding.

+3

Source: https://habr.com/ru/post/1722857/


All Articles