【发布时间】:2020-04-15 20:50:28
【问题描述】:
我需要有关以下 Apache RewriteRule 的帮助
RewriteRule ^(customers)/(active|create)/?$ /mod/customers/?type=$2 [NC,L]
此规则仅适用于/ 之后的内容,例如:http://example.com/customers/active
如果url是http://example.com/customers就不行
这个 RewriteRule 怎么写才能让http://example.com/customers 和http://example.com/customers/active 一样工作
/customers 后跟什么都没有,或/customers 后跟/active 或/create
【问题讨论】:
-
http://example.com/customers/或http://example.com/customers/active/怎么样? -
你的意思是尾随的
/? -
是的,是否允许?
-
当前网址中没有尾随
/...
标签: regex apache mod-rewrite url-rewriting