1
现在我的URL格式如下:mod_rewrite的建议
http://domain.com/index.php?template=user&id=39
我使用this function创建独特的短字符串ID。
我想实现的是:http://domain.com/u/D/
其中u
是用户页面,D
是由前面提到的函数生成的唯一短字符串。
这是我的尝试:
RewriteEngine On
RewriteRule ^/(.*)/(.*)/$ index.php?template=$1&id=$2 [L]
是否'^重写规则/([^ /] +)/([^ /] +)/ $ /index.php?template=$1&id = $ 2 [NC,L]'为你工作? –
我得到404没有找到 – bary
'RewriteRule^/?(。*)/(。*)/?$ index.php?template = $ 1&id = $ 2 [L]' – undone