Support

Admin Tools

#27496 Redirecting non-WWW to WWW

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by BasilC on Monday, 10 April 2017 16:40 CDT

BasilC
 I have a website which I recently switched to SSL using Let'sEncrypt and with Force SSL on all pages set in the Joomla Configuration. The home page is at https://www.palmersgreencommunity.org.uk/pgc. Users are redirected to the pgc folder by an .htaccess file in the root folder which I editied myself. In the /pgc folder there is an .htaccess file generated by Admin Tools which is configured to redirect non-www to www.

For some reason the SSL certificate seems to work only when using www (not an Admin Tools issue). Typing palmersgreencommunity.org.uk into the address bar of a browser brings up a Your Connection is not Secure message and the redirection to www. does not occur.

Is this something that can be solved by editing one or both .htaccess files?

The relevant part of the root .htaccess is as follows:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?palmersgreencommunity.org.uk$
RewriteRule ^(/)?$ pgc [L]

The /pgc/.htaccess file has the following:

##### Redirect index.php to / -- BEGIN

RewriteCond %{THE_REQUEST} !^POST

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/

RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$

RewriteRule ^index\.php$ http%2://palmersgreencommunity.org.uk/pgc/ [R=301,L]

##### Redirect index.php to / -- END

##### Redirect non-www to www -- BEGIN

RewriteCond %{HTTP_HOST} !^www\. [NC]

RewriteCond %{HTTPS}>s ^(on>(s)|.*>s)$

RewriteRule ^(.*)$ http%2://www.%{HTTP_HOST}/pgc/$1 [R=301,L]

##### Redirect non-www to www -- END

Grateful for any advice.

Regards,

Basil

nicholas
Akeeba Staff
Manager
Is this something that can be solved by editing one or both .htaccess files?


Unfortunately not. It comes down to the SSL certificate itself. The certificate is issued against www.palmersgreencommunity.org.uk. Let's Encrypt doesn't let you create a certificate with the necessary SAN (Subject Alternate Name) extensions that'd make it valid for the non-www and www versions of the domain name. If you examine our site's certificate, issued by COMODO, it uses SAN to declare that it's valid for both akeebabackup.com and www.akeebabackup.com.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

BasilC
Pity. Thanks for the advice. Probably not that much of an issue anyway.
Regards,
Basil

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!