【发布时间】:2012-06-21 06:07:47
【问题描述】:
可能重复:
How to change appearance of URL from within a PHP script
我的地址栏中有这个
localhost/somedirectory/main.php?id=123456
如何隐藏那些GET变量,所以变成了
localhost/somedirectory/main/123456
我知道 .htaccess 是答案,但到目前为止我的尝试都无济于事。有人可以说明如何实现它吗?
【问题讨论】:
-
您可以发布一些您尝试过的代码吗?那里有大量的 .htaccess sn-ps。您是否无法确定文件的放置位置?
-
@Zach L 我从网上获得的 htaccess 脚本之一,似乎无法在 RewriteRule 上使用 RewriteEngine (/somedirectory/([a-z]+)$ $1.php?$2=$3 [L]
标签: php