簡體   English   中英

在 Vuejs 中獲取對 seo 友好的 url 的 url 參數

[英]Get url Parameter for seo friendly url in Vuejs

I want to get parameter uniqid from url but im not be able to get it.In this case i used rules in .htaccess to make this url structure example.com/page.php?uniqid=123 to this structure example.com/page/id/123出於對 seo 友好的原因,但在我使用.htaccess規則之前,我能夠通過 URLSearchParams 獲得它,例如:

let urlParams = new URLSearchParams(window.location.search);
let idresolve = urlParams.get('uniqid');

現在我無法在.htaccess中為此example.com/page/id/123結構添加規則后獲得123 123

我已經使用window.location.pathname在 url 上設置手動偏移量。

示例: window.location.pathname(9)將為此 url example.com/page/id/123檢索123

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM