Sorry, SMF was unable to connect to the database.

Started by Cola-Coca, April 06, 2025, 12:48:05 AM

Previous topic - Next topic

Cola-Coca

Hi,
I have a strange problem.
When I type in the web browser: https://mywebsite.com/ everything works normally, the forum opens and everything is ok.
But when I type with www for example: https://www.mywebsite.com/ I get an error:
Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.


I uploaded repair_settings.php and everything is set correctly. Does anyone know what the problem is here?
I LOVE SMF

Illori

have you reached out to your host? usually that is an issue they need to fix.

shawnb61

Check your redirects in .htaccess.

Those are two different urls.  So one will work & one won't.

To make them both work automatically, you need a redirect from the wrong one to the right one.  These are usually in .htaccess.

Most hosts have a cpanel app to make this easy, eg, to add or remove www, or to redirect to https, or both.
A question worth asking is born in experience & driven by necessity. - Fripp

Sir Osis of Liver

.htaccess


# 301 REDIRECT HTTP TO HTTPS AND WWW TO NON-WWW
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
</IfModule>

When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: