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.
https://www.concrete5.org/community/forums/5-7-discussion/concrete5.7-setup-for-https-or-ssl-access/#814087
Add this you your .htaccess file in your main directory:
Message me if it doesn't work, happy to get it working for you
# 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
Viewing 15 lines of 20 lines. View entire code block.
Message me if it doesn't work, happy to get it working for you
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.
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
Did you also enable Pretty URLs in the admin settings?
System & Settings -> URLs and Redirection -> Tick the 'remove index.php' box
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>
# 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>
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
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
Looks like there is an issue with the SEP Tools Package, so I'm looking into that.
Happy to take a look at this for you.
Email me on hello @ tm-designs.co.uk
Email me on hello @ tm-designs.co.uk
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
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
The website is running 5.7.5.13.