[英]Is it possible to redirect the example.com/index.php?page=abc to example.com/abc?
[英]Is “example.com/index.php/page/about/” good practice?
通常,人們會發現該URL是“ example.com/index.php?page=about”或更佳的是“ example.com/page/about/”。 但是在這種情況下,它是“ example.com/index.php/page/about/”。 注意中間的index.php。
問題:
謝謝大家的耐心配合。 一般來說,我是Web開發的新手。
我不太確定您要問的是什么,但是:“ example.com/index.php?page=about”是很正常的“頁面”,它是index.php可用的get變量。 http://php.net/manual/en/reserved.variables.get.php您可以從用戶視圖中刪除變量,或者僅使用POST而不是GET。
如果您確實想要(但不應該)從$ _SERVER ['REQUEST_URI']解析出您需要的內容,則可以使用精確的URL進行各種技巧,例如example.com/index.php/page / about或example.com/page/about引回index.php。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.