我試着用這裏發佈的示例嘗試過,但我沒有設法讓我的htaccess正常運行。.htaccess url用兩個變量重寫
這裏的情況: 我有看起來像這樣的鏈接
domain.com/sport/football/index.php?lang_id=1&page_id=500
(主頁) domain.com/sport/football/index.php?lang_id=1&page_id=505
(玩家) domain.com/sport/football/index.php?lang_id=1&page_id=510
(教練)...
我想重新命名他們
domain.com/sport/football/
domain.com/sport/football/players/
domain.com/sport/football/coaches/
等等 併爲所有非指定PAGE_ID的重定向到主頁。
所有幫助非常感謝。
謝謝喬恩,它是做一些改寫,但不是我想要的。 當我輸入除家庭以外的頁面的新網址時,出現404錯誤,並且我重定向到/ sport/football /當我嘗試到達家中時。 請注意,目錄中的默認頁面是index.html,而不是index.php。對不起,我忘了提及 – Aleks