首先確認 apache 設定檔
AllowOverride None
修改成
AllowOverride All
重啟apache serivce
情境1
網址列輸入 http://example.com/b/1234567890 且後面的參數為10個英數字
實際上是連結到 http://example.com/b.php?no=1234567890
vi .htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^b/(\w{10})$ "b.php?no=$1"

- Apr 17 Mon 2017 11:10
-
apache rewrite 範例
請先 登入 以發表留言。