首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Mod-rewrite;apache规则

Mod-rewrite;apache规则
EN

Stack Overflow用户
提问于 2013-02-23 19:19:11
回答 1查看 78关注 0票数 0
代码语言:javascript
运行
复制
RewriteEngine on
RewriteRule ^([A-Za-z0-9-_]+)$ index.php?paste=$1 [L] 

正如您在上面看到的,它将site.com/index.php?paste=pasteID转换为site.com/pasteID

现在我想知道一种方法,我可以这样编辑粘贴。

代码语言:javascript
运行
复制
site.com/index.php?paste=pasteID&page=edit
site.com/pasteID/edit

有没有什么我可以做的?

EN

Stack Overflow用户

回答已采纳

发布于 2013-02-23 19:33:41

代码语言:javascript
运行
复制
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=534
  • domain.com/abc index.php?paste=abc
  • domain.com/abc123 index.php?paste=abc123
  • domain.com/534/edit index.php?paste=534&page=edit
  • domain.com/abc/edit index.php?paste=abc&page=edit
  • domain.com/abc123/edit index.php?paste=abc123&page=edit

->

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15039924

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档