0

I used this code

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(shop|university)(/.*)?$ https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] RewriteCond %{HTTPS} on RewriteRule !^(shop|university)(/.*)?$ http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] </IfModule> 

I want redirect http to https two categories (shop and university), other i want redirect to http

BUT, after installation of the rules to all https transfers me on http but from universiti and shop puts on the main page. what could it be?

1 Answer 1

1

Try :

<IfModule mod_rewrite.c> RewriteEngine On #https to http RewriteCond %{HTTPS} ^on$ RewriteCond %{REQUEST_URI} !^/(shop|university)/ RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] #http to https RewriteCond %{HTTPS} ^off$ RewriteCond %{REQUEST_URI} ^/(shop|university)/ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] </IfModule> 
Sign up to request clarification or add additional context in comments.

1 Comment

when i used it, i have MORE errors: Mixed Content: The page at 'example.com/shop' was loaded over HTTPS, but requested an insecure stylesheet 'example.com/wp-includes/css/admin-bar.min.css?ver=4.4'. This request has been blocked; the content must be served over HTTPS.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.