Error on website with www

Started by pedromst, October 28, 2023, 06:31:21 PM

Previous topic - Next topic

pedromst

Hello, when I created my website account I submitted the account with www and now when I enter the website without the www I have an error, even though I have the SSL redirecting fine.

https://www.askthesoul.com/ > This is how it works
https://askthesoul.com/ > Does not work


Image > https://freeimage.host/i/JfBhbQj

Painkiller88

hi,

if you use apache you could use a rewrite rule, to force all requests to be redirected to www.

In this case you would never have problems when your visitors just enter the domain without www.

just add this to the .htaccess file of your page:

RewriteEngine On
### re-direct to www
RewriteCond %{http_host} !^www.example.com [nc]
RewriteRule ^(.*)$ http://www.example.com/$1 [r=301,nc]

pedromst


I had already added something like this and I just put your code changing my domain at the end of the file and it doesn't do anything.

I think it was to create the website account with www.

Is there a way to remove the www from the account?


Quote from: Painkiller88 on October 28, 2023, 07:09:42 PM
hi,

if you use apache you could use a rewrite rule, to force all requests to be redirected to www.

In this case you would never have problems when your visitors just enter the domain without www.

just add this to the .htaccess file of your page:

RewriteEngine On
### re-direct to www
RewriteCond %{http_host} !^www.example.com [nc]
RewriteRule ^(.*)$ http://www.example.com/$1 [r=301,nc]

josemnunez

The correct thing would be to delete the account and create it again without the www, this can cause countless problems later

pedromst

Quote from: josemnunez on October 28, 2023, 08:29:22 PM
The correct thing would be to delete the account and create it again without the www, this can cause countless problems later

And is there no way to edit the account and remove the www?

Do I really have to delete the account and install a backup?

josemnunez

Yes, you must edit the domain name in
root_cwp.user
postfix.*
Edit vhosts in Apache and any other webserver

pedromst

Could you tell me where I can find these files to change or give me step by step instructions on how to do so?


Quote from: josemnunez on October 28, 2023, 08:50:00 PM
Yes, you must edit the domain name in
root_cwp.user
postfix.*
Edit vhosts in Apache and any other webserver