Need Help with htaccess 301 redirect to SSL for c57 Website

Permalink
This shoudl be a quick project. I have a website that I can't seem to figure out how to get the htaccess file properly setup so that if forces SSL on the site and forces www with Pretty URLs turned on. When I turn pretty URLs on I'm getting a 'Website isn't redirecting properly' message. I'm not sure why this is happening however. I have other c5 sites on the same server and the redirects are working fine. Have tried multiple things, but on this site I can't get it to work properly. Looking for help to get it fixed today.

pixo
 
manup replied on at Permalink Reply
manup
https://www.concrete5.org/community/forums/5-7-discussion/concrete5.7-setup-for-https-or-ssl-access/#814087
pixelhero replied on at Permalink Reply
pixelhero
Add this you your .htaccess file in your main directory:

# Rewrite Rules
<IfModule mod_rewrite.c>
    RewriteEngine On
    # Force SSL
    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    # Force Trailing slash
    RewriteCond %{REQUEST_URI} /+[^\.]+$
    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
    # Force www
    RewriteCond %{HTTP_HOST} !^$
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    # Concrete5 Pretty URLs


Message me if it doesn't work, happy to get it working for you
pixo replied on at Permalink Reply
pixo
Thanks. I had tried that before and just copied and pasted what you included into the htaccess file, but I'm still getting the 'The page isn’t redirecting properly' message when I turn on Pretty URLs.
pixelhero replied on at Permalink Reply
pixelhero
Can you show me your full htaccess file?

Did you also enable Pretty URLs in the admin settings?

System & Settings -> URLs and Redirection -> Tick the 'remove index.php' box
pixo replied on at Permalink Reply 1 Attachment
pixo
Yes, Pretty URLs is checked on. Here is what is in the htaccess file. Also, a screen shot of the URLs & Redirection page.

# Rewrite Rules
<IfModule mod_rewrite.c>
RewriteEngine On

# Force SSL
RewriteCond %{SERVER_PORT} 80
RewriteRule ^https://www.%{HTTP_HOST}%{REQUEST_URI}... [R=301,L]

# Force Trailing slash
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

# Force www
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^https://www.%{HTTP_HOST}%{REQUEST_URI}... [R=301,L]

# Concrete5 Pretty URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
pixelhero replied on at Permalink Reply
pixelhero
It looks to me like your hosting does not have mod_rewrite enabled.

Are you hosting it on a dedicated server or with another hosting provider?

Can't help much more without a live url and access to your FTP to put some tests in the htaccess file to see if it is enabled or not.

Message me if you'd like me to look at it
pixo replied on at Permalink Reply
pixo
Looks like there is an issue with the SEP Tools Package, so I'm looking into that.
TMDesigns replied on at Permalink Reply
TMDesigns
Happy to take a look at this for you.

Email me on hello @ tm-designs.co.uk
pixelmargin replied on at Permalink Reply
pixelmargin
Hi

hope you are using latest 5.7 version. Is some version we had an issue with saving canonical url on backend. Update or edit through db may work. Let me know if you need quick help. You may reach me on info(@)pixelmargin.com

Thanks
pixo replied on at Permalink Reply
pixo
The website is running 5.7.5.13.