使用的.htaccess创造清洁的URL结构 [英] Using .htaccess to create clean URL structure
本文介绍了使用的.htaccess创造清洁的URL结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何重定向
website.com/path/?p=4927304
website.com/path/?p=4927304
到
website.com/path/4927304
website.com/path/4927304
,其中的数量是动态的。
where the number is dynamic.
感谢
推荐答案
这条规则将重定向像 /路/ P = 4927304
网址 /路径/ 4927304
:
This rule will redirect URLs like /path/?p=4927304
to /path/4927304
:
RewriteCond %{QUERY_STRING} ^p=([0-9]+)$
RewriteRule ^path/$ /path/%1 [R]
这篇关于使用的.htaccess创造清洁的URL结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文