Jose
Jose

Reputation: 25

Redirect rule creates a link with a double slash

I want to redirect a link like this one: www.mysite.com/article905.html/ to www.mysite.com/article-title/ but I can't figure out how to do it.

I've tried adding a Redirect rule to the .htaccess like this one:

Redirect permanent /article905.html/ http://www.mysite.com/article-title/

But once applied, the system actually redirects me to http://www.mysite.com/article-title//

How can I avoid the double slash?

Upvotes: 1

Views: 116

Answers (1)

anubhava
anubhava

Reputation: 785306

Use RedirectMatch for regex matching:

RedirectMatch 301 ^/article905\.html/?$ http://www.mysite.com/article-title/

Upvotes: 1

Related Questions