I am looking for a regex option to use with htaccess.
I need to strip out a £ symbol from any url and then redirect to another domain whilst maintaining the parameter that was after the £ symbol
So
example.com/£7.50
gets redirected to
paypal.me/myid/7.50
This was the htaccess that redirects ONLY example.com/£7.50
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.exmaple.com$
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.+$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]
{32}.txt(?: Comodo DCV)?$
RewriteRule ^£7.50$ "https://paypal.me/myid/7.50" [R=301,L]
I have tried some of the options in
https://gist.github.com/ScottPhillips/1721489
with no joy. Any ideas?
So anything with a £ symbol in the URL, needs the £ removing and redirecting to Paypal.me with my id and numeric value appended.
3
Answers
This was the working code in the end
You can use: