如何允许/ X /而不是?ID = X访问URL?

时间:2011-08-30 22:47:19

标签: php .htaccess get directory

在我和我的朋友网站上,我们想知道如何获取?ID = $ ID只是为了显示为http://host/profiles/1/等文件夹

我们猜测htaccess是必需的,但这是怎么做到的? 感谢。

1 个答案:

答案 0 :(得分:2)

这样的事情对你有用:

RewriteEngine On
RewriteRule ^profiles/(\d+)/$ /profile?id=$1 [L]

它将globalschat.co.cc/profiles/1/重写为globalschat.co.cc/profile?id=1