stckvrw
stckvrw

Reputation: 1801

How to change existed redirect in order to add redirecting to https

In my file .htaccess I have the following redirect

RedirectMatch ^(.+)/$ $1

If I follow by link e.g. https://example.com/path/ it redirects to http://example.com/path

So it removes the trailing slash as expected, but redirects to http instead of https

How to change this specific redirect only so that it redirects to https:// without adding general redirect all requests to https ?

Upvotes: 0

Views: 33

Answers (1)

Valeriu Ciuca
Valeriu Ciuca

Reputation: 2094

Simply add your domain with https like this:

RedirectMatch "^(.+)/$" "https://www.example.com/$1"

Upvotes: 1

Related Questions