WordPress.org

Ready to get started?Download WordPress

Forums

Redirect to https WITH www EXCEPT for /blogs/* (1 post)

  1. jetlej
    Member
    Posted 2 years ago #

    How can I redirect all pages within WordPress to https://www EXCEPT for URL's beginning with the slug /blogs/ and also a single page: /client-ipad-contest.

    I put the following code in my htaccess file after the wordpress-created lines, but nothing changed:

    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} !^/blogs/
    RewriteCond %{REQUEST_URI} !^/client-ipad-contest
    RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
    RewriteRule . https://www.%2%{REQUEST_URI} [R,L]
    
    RewriteCond %{HTTPS} on
    RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
    RewriteRule . https://www.%2%{REQUEST_URI} [R,L]

Topic Closed

This topic has been closed to new replies.

About this Topic