php - 在 .htaccess 中重写规则 - 波斯语的正则表达式

标签 php regex .htaccess mod-rewrite expression

我写了一个正则表达式,以便在使用波斯语时它能正常工作。 我正在使用以下代码,但以下代码不起作用。

RewriteRule ^test/([0-9]+)/([\u0600-\u06FF]+)/?$ test.php?id=$1&title=$2 [NC,L]

最佳答案

为什么不匹配所有内容?我不确定 - 字符范围是否按照您使用的方式工作:

RewriteRule ^test/([0-9]+)/(.+?)/?$ test.php?id=$1&title=$2 [NC,L]

关于php - 在 .htaccess 中重写规则 - 波斯语的正则表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25003666/

相关文章:

php - 服务器即时创建文件供客户端保存

.htaccess - 为什么此 RedirectMatch 301 会替换 & 符号?

javascript - URL重写: Show all files of certain directories at root of site

.htaccess - 不可见的 .htaccess 从/public_html/重定向到/public_html/folder

php - 在php中添加一个月

javascript - 如何使用javascript和php mysql删除一行

php - Yii 使用用户身份对象分配外键值

java - 使用正则表达式搜索 HashSet

python - 在Python中查找字符串中以逗号分隔的所有数字

regex - 在数字字符串中插入逗号