简体   繁体   English

WordPress使用htaccess将URL查询字符串转换为斜线并屏蔽单个路径

[英]Wordpress convert url query string to slash and mask single path using htaccess

Can anyone please help me understand if there is any standard function or process in wordpress that can be used to convert dynamic query strings to static just like how wordpress converts dynamic url 任何人都可以帮助我了解wordpress中是否有任何标准函数或过程可用于将动态查询字符串转换为静态,就像wordpress如何转换动态网址一样

for example my url is generated as 例如我的网址生成为

http://example.com/payment/?username=nijesh

I want it to be converted as below 我希望将其转换如下

http://example.com/nijesh

I would use the template_include filter . 我会使用template_include过滤器 You can access the global $wp_query variable and return the appropriate template based on your query string. 您可以访问全局$wp_query变量,并根据您的查询字符串返回适当的模板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM