Handling SEO Friendly URL with Non-English Charact

2019-08-09 19:38发布

问题:

I have URLs like this: .com/topic.php?id=6 I can convert them to this: .com/topic/5.html This works, but now I want to convert .com/topic/title.html The "title" is dynamic, for example çağdaş and can contain non-English characters like Şor Ğ or Ü

In this case, I first convert characters to acceptable equivalents like Ş to S or Ü to U If I convert çağdaş to cagdas then my URL looks like this .com/topic/cagdas.html

I have used cagdas in SQL queries to select the proper row, but in the database, it is stored as çağdaş not cagdas. What can I do to remedy this, so that the database stores my dynamic URL in the converted form, as cagdas?

回答1:

The simplest solution is to store both çağdaş and cagdas in the database table.