2015-08-08 92 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]