在我的php网站中,我需要以特定的方式显示我的urn。
我需要隐藏查询字符串参数,只想显示URL中的值,即
mydomain.com/city.php?place='usa'&id=2我需要展示
my domain.com/city-2/usa有可能吗?
请帮帮我。我现在的情况很严重。
提前感谢
发布于 2012-04-21 13:10:07
是的,这是可能的:
RewriteEngine On
RewriteBase /
RewriteRule ^city-(\d+)/(.*) city.php?place=$2&id=$1您需要将其放入网站根目录下的.htaccess中。要使其正常工作,您需要启用.htaccess解析,并启用apache模块(假设您将mod_rewrite作为web服务器)。
在official documentation中有更多信息
https://stackoverflow.com/questions/10256393
复制相似问题