在我的网站中,即在我的服务器上,我有googlee.technology/Verify/191711443.pdf,我想知道用户是否输入没有pdf扩展名的googlee.technology/Verify/191711443,我想在我的网页中显示相同的结果。怎么做。 这是我的Firebase.json文件代码:
{
"hosting": {
"site": "chinnapareddy",
"public": "y",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
},
`"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"source": "functions"`
}
}
答案 0 :(得分:2)
要将/Verify/191711443
重写为/Verify/191711443.pdf
,请在firebase.json
中使用它:
"hosting": {
// ...
// Add the "rewrites" attribute within "hosting"
"rewrites": [ {
"source": "/Verify/191711443",
"destination": "/Verify/191711443.pdf"
}]
}
更新:这是您上次评论中的JSON 应该应如下所示:
{
"hosting": {
"site": "chinnapareddy",
"public": "y",
"ignore": ["firebase.json", "/.*", "**/node_modules/"]
"rewrites": [{
"source": "/Verify/191711443",
"destination": "/Verify/191711443.pdf"
}]
},
"functions": {
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"],
"source": "functions"
}
}