看板 PHP 關於我們 聯絡資訊
各位前輩大家好 小弟之前初學php沒多久 最近有個作業需要寫出類似部落格形式的簡易內容網站 但過去所學的php+MySQL中,如果點入一篇文章 網址會是:www.demo.com?id=123 但如果希望能夠像wp呈現固定網址:www.demo.com/123/ 這樣子的話,請問該怎麼作呢?或查什麼關鍵字呢? 我google都只查到wp的做法 如果有錯之處初學還請見諒 先謝謝各位了!! -- Sent from my Android -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 27.244.10.9 ※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1440899514.A.34F.html
my1938: 也想知道+1 08/30 10:11
kevin13: 搜尋url rewrite, 作法可參考codeigniter的 .htaccess檔 08/30 10:20
wonderow: 感謝k大 08/30 10:54
wonderow: 但想請再請問:這樣的話是會變成全部都指向到同一個網址 08/30 10:54
wonderow: ?還是可以不同篇文章不同網址,像www.demo.com/123/跟w 08/30 10:54
wonderow: ww.demo.com/456/ 08/30 10:54
alex0914: https://github.com/c9s/Pux 08/30 11:01
linbob09: 要看你如何判斷喔 09/01 02:38
dh4mve: 如果用frameset 應該可以做到一樣的效...如果有錯請高手 09/01 15:28
dh4mve: 指正 09/01 15:28
MOONRAKER: 那請問用frameset如何做到一樣的效 09/01 15:39
dh4mve: 假設原本網頁是index.php 切成兩邊,這樣按進文章網址還是 09/01 22:10
dh4mve: 顯示index.php 09/01 22:10
MOONRAKER: 請問這樣要怎樣把host.com/123對應到host.com?id=123 09/01 22:36
dh4mve: 對不起我錯了 09/01 23:51
b510336: 去學laravel吧... 09/02 14:45
wilson200106: 第一個你需要 .htaccess rewrite 09/02 15:22
wilson200106: 第二個你需要一個 route class來協助你處理轉址判斷 09/02 15:23
ilay: index.php?request=item/123 09/08 09:30
ilay: 用 http server 的 url rewrite 規則整理一下即可 09/08 09:32
ilay: apache 可寫在 .htaccess 裏頭 09/08 09:33
ilay: nginx 就要另外寫 http config 了 09/08 09:33