[英]Wordpress, Add Rewrite Rule to a custom URL
I need to get an URL for a json file as: https://domain.name/.well-known/assetlinks.json I need to get an URL for a json file as: https://domain.name/.well-known/assetlinks.json
So I Added the add_rewrite_rule function as:所以我添加了 add_rewrite_rule function 为:
add_rewrite_rule( '^.well-known/assetlinks.json$','index.php?asset-link=assetlinks', 'top' );
But I can not get an satisfying resulto on my end, could you please help me to get the error on the script?但是我最终无法获得令人满意的结果,您能帮我解决脚本上的错误吗?
Thanks!谢谢!
Here is the solution for this Question:这是此问题的解决方案:
add_rewrite_rule( '^\.well-known\/(.*)?','index.php?asset-link=assetlinks', 'top' );
This can to you print an json file in wordpress as: https://domain.name/.well-known/assetlinks.json/这可以让您在 wordpress 中打印 json 文件为: https://domain.name/.well-known/assetlinks.json/
As required on: https://developer.android.com/training/app-links/verify-site-associations#publish-json根据要求: https://developer.android.com/training/app-links/verify-site-associations#publish-json
THanks!谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.