我有一個網站,顯示有關網上商店的信息。我需要以下內容:如何顯示不存在於PHP中的頁面?
當您鍵入example.com/shop/name-shop
時,應顯示名稱商店頁面。
我想只有文件example.com/shop.php
其中顯示基於網址商店的信息。我不喜歡使用example.com/shop?name-shop
。
這是可能的,或者我需要爲每個商店創建一個文件?我試圖做到這一點與錯誤頁面和標題的位置,工作正常,但在網址顯示example.com/shop
而不是example.com/shop/name-shop
。
謝謝。
編輯: 我使用Apache中的.htaccess與ErrorDocument 404 /error404.php
在文件error404.php我有一個,如果檢查網址是http://example.com/shop/*
URL包含/店與header ("location: website")
/重定向到正確的店作品。但在瀏覽器中的url只顯示example.com/shop
而不是example.com/shop/name-shop
。顯然,因爲我重定向到shop.php