问题描述
我有这样的URL:.com/topic.php?id=6
我可以将它们转换为:.com/topic/5.html
这可行,但是现在我要转换.com/topic/title.html
标题"是动态的,例如çağdaş
,并且可以包含非-英文字符,例如Ş
或Ğ
或Ü
在这种情况下,我首先将字符转换为可接受的等效形式,例如Ş
到S
或Ü
到U
如果将çağdaş
转换为cagdas
,则我的URL看起来像这样.com/topic/cagdas.html
/p>
我已经在SQL查询中使用cagdas
来选择适当的行,但是在数据库中,它存储为çağdaş
而不是cagdas
.我可以做些什么来弥补这一点,以便数据库将动态URL以转换后的形式存储为cagdas
?
最简单的解决方案是将çağdaş
和cagdas
都存储在数据库表中.
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
?
The simplest solution is to store both çağdaş
and cagdas
in the database table.
这篇关于使用非英语字符处理SEO友好URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!