https://example.com/frases/f/como-fazer/Card%20link
The Card%20link
(aka "trash") that needs to be removed is at the end of the URL-path (not the query string as mentioned in the other answer).
You can remove this using mod_rewrite, near the top of the root .htaccess
file.
For example:
RewriteEngine On
RewriteRule ^(.+/)?Card\slink$ /$1 [NC,R=301,L]
Note that the URL-path matched by the RewriteRule
pattern has already been %-decoded (ie. URL decoded) so we need to match against a literal space, not %20
(an encoded space). In the above regex, the shorthand character class \s
matches any whitespace character.
The regex ^(.+/)?Card\slink$
matches any URL-path that ends with /card%20link
(case-insensitive), including requests that should otherwise be for the homepage (if that is a thing, eg. example.com/Card%20link
).
You do not need to repeat the RewriteEngine
directive if this already occurs elsewhere in the config file. (Although for readability, the RewriteEngine
directive should appear just once at the top of the file.)
You should first test with a 302 (temporary) redirect to avoid potential caching issues. And you will need to clear your browser cache before testing.