2015-08-08 91 views
0

我想提出我的網址:使用的.htaccess重寫URL用GET變量

example.com/index.php?this=a&that=b 

到:

example.com/index.php/a/b 

所以,每當有人訪問這個頁面直接:

example.com/index.php/a/b 

它將在地址欄中顯示爲鍵入,但會呈現以下內容:

example.com/index.php?this=a&that=b 

這是怎麼完成的?

+0

什麼時候人們開始讀取單證? – arkascha

回答

1

您可以使用您的.htaccess

RewriteEngine on 
RewriteRule ^index\.php/([^/]+?)/(.+)/?$ index.php?this=$1&that=$2 [L,NC]