With www or not?


#1

Please fill out the fields below so we can help you better.

I ran this command: certbot run -d mydomain.com
and
I ran this command: certbot run -d www.mydomain.com

My operating system is : Debian Jessy (last)

2 trouble now :

1 . On firefox only, if I ask http://mydomain.com https://mydomain.com (without www), I’ve got an alert screen with a no secure website (I think this is normal because certificate is for www.mydomain.com)

  1. impossible to maintain my htaccess on this domain (I’ve got error 500 evn with an empty htaccess)

Could you help ?
F.


#2

You can ask for a single certificate with more than one name in it, like this:

certbot run -d example.com -d www.example.com

If you already have a certificate you’re using, but it should have an additional name you can write e.g.

certbot run --expand -d example.com -d www.example.com

The --expand means “if I have a certificate with some of these names, replace it with one that has all of them”


#3

Thanks tialaramex ! Your post help me ! (ssllabs.com test are ok)
Now I’ve got an antoher issue:

both
http://www.mydomain.com
and
https://www.mydomain.com

give me : www.www.mydomain.com (with no htaccess)

To know : My prefered/canonical domain is with www

Any guess ?


#4

I’m guessing you have a redirect ( which is incorrect) in your apache config. If you provide your domain name we can do better checks.


#6

I suspect it’s cached in your local browser ( unless you have more than one server). I’m not getting a redirect.

If you previously had a “permanent” redirect, then your browser would remember that, and continue to redirect. Can you try on a different browser / computer ?


#7

You’re right ! Sorry for this silly issue…
Now, what’s about the best way redirecting without www to with www.


#8

Glad that fixed it :slight_smile:

Whether you want to redirect all to the “www” version of the “non-www” version is a personal choice, there is no real difference between the two as far as I’m aware (although it is best to redirect all to the same one, whichever you choose )


#9

Yes, it’s a personnal (and historic) choice, I’ve set all canonical with www but I prefere make a clean job and also serving www. pages.

Very strange : I cant set any htaccess anymore (since https) even with just one simple line like "ErrorDocument 404 /error.php"
That give me an error 500 each time


#10

What’s in the apache config for the domain - in the 443 virtualhost ? My guess is that you haven’t set the options to allow htaccess there.


#11

Hi,
443 virtualhost : strange because I have not edit this virtualhost :

< Directory /home/myfolder/public_html >
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/myfolder/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/myfolder/fcgi-bin/php5.fcgi .php5
< /Directory >


#12

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.