问题
I have all my URLs like this example: http://domain.com/="%7b%7bstore
I would like to create a RewriteRule
to remove the trailing ="%7b%7bstore
from the url.
The string is always at the end. The rule has to leave any other query string, url part untouched.
I figured that %7b
translates to {
.
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!
回答1:
You can use this rule as your first rule in root .htaccess:
RewriteEngine On
RewriteRule ^(.*?)="\{\{store(.*)$ /$1$2 [L,R=301]
来源:https://stackoverflow.com/questions/24268906/remove-exact-string-from-end-of-url-apache-htaccess-rewriterule