content01
content01

Reputation: 3225

Can't make regex to match URL in redirect rule in .htaccess

I have the following url:

http://mysite.com/dir/someone-else%E2%80%99s-black-tie/

I want my htaccess to redirect that to:

http://mysite.com/dir/someone-elses-black-tie/

How can accomplish that?

Thanks!

Upvotes: 1

Views: 118

Answers (1)

Ωmega
Ωmega

Reputation: 43673

RewriteEngine On
RewriteCond %{HTTP_HOST}:%{SERVER_PORT}s ^(.*):(443(s)|\d+s)$
RewriteRule ^/?(dir/someone-else).+(s-black-tie/?)$ http%3://%1/$1$2 [R=301,L]

Upvotes: 1

Related Questions