从URL Apache htaccess重写器的末尾删除确切的字符串 [英] Remove exact string from end of url apache htaccess rewriterule
本文介绍了从URL Apache htaccess重写器的末尾删除确切的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有我的所有URL,例如以下示例: http://domain.com/="%7b%7bstore
I have all my URLs like this example: http://domain.com/="%7b%7bstore
我想创建一个 RewriteRule
,以从网址中删除结尾的 =%7b%7bstore
.
I would like to create a RewriteRule
to remove the trailing ="%7b%7bstore
from the url.
字符串始终在结尾.该规则必须保留所有其他查询字符串,即url部分.
The string is always at the end. The rule has to leave any other query string, url part untouched.
我发现%7b
会翻译为 {
.
我对这条规则很了解,但无法弄清其余的内容:
I got this far with the rule, but can't figure out the rest:
RewriteRule ^/?(.*)store$ /$1 [L,R=301]
有人可以帮忙吗?谢谢!
Could anybody help? Thank you!
推荐答案
您可以将此规则用作根.htaccess中的第一个规则:
You can use this rule as your first rule in root .htaccess:
RewriteEngine On
RewriteRule ^(.*?)="\{\{store(.*)$ /$1$2 [L,R=301]
这篇关于从URL Apache htaccess重写器的末尾删除确切的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文