Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
客户在我的网站上输入序列号,然后我有一个网络服务来检查它,我想知道我是否可以使用 httaccess 和正则表达式将序列号中输入的任何 Os 替换为零。我可以比更新、测试和部署应用程序更快地推出更新的 httaccess 文件。
以下示例将仅替换最后一次出现有没有办法让它替换每个出现的序列号,例如HI-QWVo-3UGoS-YTSQJ
HI-QWVo-3UGoS-YTSQJ
^SN=(.*)o(.*) SN$10$2
Try this code in your DOCUMENT_ROOT/.htaccess file:
DOCUMENT_ROOT/.htaccess
RewriteEngine On RewriteRule ^SN(.*)o(.*)$ SN$10$2 [L,NC]