Redirect all pages to HTTPS except one in particular

Asked

Viewed 692 times

6

I have the following code on .htaccses to redirect the entire site to HTTPS:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://meudominio.com/$1 [R,L]

However I would like to leave a page out of this redirect in order to open in HTTP:

http://meudominio.com/obrigado.php

How can I apply this rule?

1 answer

7

You can add a condition to your redirect rule for that particular address.

Before the line RewriteRule, add:

RewriteCond %{REQUEST_URI} !^/obrigado.php$

This way, the redirect rule is only applied if the address does not stop at the obrigado.php.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.