Note that there are some explanatory texts on larger screens.

plurals
  1. POhtaccess -> need to redirect all www to non-www and one page only to ssl
    primarykey
    data
    text
    <p>I've looked "everywhere" but just can't seem to figure this one out.</p> <p>I need the htaccess to do 2 things for me:</p> <ol> <li>Force all www requests to non-www requests</li> <li>Also force http (non-ssl) on all pages but one in which case I need ssl</li> </ol> <p>Also, this is a wordpress site using permalinks, so I've got that chunk of htaccess code wordpress also puts in there. But somehow everything works fine, except for when I go to the page that needs to be forced to ssl, then it just redirects to the root of the site.</p> <p>This is what my code looks like:</p> <p>RewriteEngine On RewriteBase /</p> <pre><code># Redirect from www to non-www RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301] # Turn SSL on for secure-page RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} ^secure-page[/]?$ RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] # Turn SSL off everything but secure-page RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} !^secure-page[/]?$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L] # BEGIN WordPress RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </code></pre> <p>So results are:</p> <ol> <li>any www and non-www and http urls are redirected to non-www and http -> OK</li> <li>any www and non-www and https urls (excl. secure-page) are redirected to non-www and http -> OK</li> <li>secure-page url are redirected to the site root and I can't figure out why -> NOT OK </li> </ol> <p>Can someone please help? Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload