RewriteEngine on
RewriteRule ^([A-Za-z0-9-_]+)$ index.php?paste=$1 [L] 正如您在上面看到的,它将site.com/index.php?paste=pasteID转换为site.com/pasteID
现在我想知道一种方法,我可以这样编辑粘贴。
site.com/index.php?paste=pasteID&page=edit
site.com/pasteID/edit有没有什么我可以做的?
发布于 2013-02-23 19:33:41
RewriteEngine on
RewriteRule ^([A-Za-z0-9-_]+)$ index.php?paste=$1 [L]
RewriteRule ^([A-Za-z0-9-_]+)/edit$ index.php?paste=$1&page=edit [L]示例:
domain.com/534 index.php?paste=534domain.com/abc index.php?paste=abcdomain.com/abc123 index.php?paste=abc123domain.com/534/edit index.php?paste=534&page=editdomain.com/abc/edit index.php?paste=abc&page=editdomain.com/abc123/edit index.php?paste=abc123&page=edit->
https://stackoverflow.com/questions/15039924
复制相似问题