Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How long does changes on Direct Admin take effect?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How long does changes on Direct Admin take effect?

team_traitorteam_traitor Member
edited October 2020 in Help

Hi,

I recently have problem with DirectAdmin especially with subdomain.

This is very annoying and I need help.

  • hard to add individual ssl certificate on subdomain

    • the fix is to use LE wildcard (we are lucky it is free. If not we're FUCl<eD).
      (they should offer this kind of configuration where we can put SSL separately per subdomain)
  • How to fix this subdomain redirecting and adding www?
    Ex: When I create a subdomain "hello" and type into my browser "hello.domain.com" I am being redirected to www.hello.domain.com. How to fix this?

PS:
I don't have access to server since this is a shared hosting package so I don't have permission to manually edit the webserver settings etc.
It is really annoying to ask customer support, too long to response.

  1. How to fix the redirection issue with subdomain?
  2. How can I efficiently redirect non http to https?

Been googling for 4 hours now. :-(
Hope someone out there experience this and have a fix. Or point me where I did wrong. Thanks in advance.

Comments

  • Hi Bud,
    You should really ask your provider for help on this.

    • To add individual subdomain level SSL - While generating SSL, you have an option to select whatever subdomain you want to install ssl for :)
    • Auto www redirect sounds weird. Never seen that. Have you checked your domains .htaccess settings?
    • While generating SSL, look at the bottom left corner, there’s an option to select which will allow you to force ssl redirect :)
  • @seriesn said: To add individual subdomain level SSL - While generating SSL, you have an option to select whatever subdomain you want to install ssl for

    I found that too but it seems like the previous cert are overwritten. I might be wrong.

    @seriesn said: Auto www redirect sounds weird. Never seen that. Have you checked your domains .htaccess settings?

    This is my htaccess

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    

    I have dirty for that subdomain redirect too. Instead of adding a subdomain through subdomain management what I did was add a new domain via Domain Management and create subdomain.domain.com

    I am now waiting again to make the changes take effect. How long usually DA check the new settings?

    PS: I am not really good with apache and similar webserver.
    I prefer nginx due to simplicity.

  • @team_traitor said:

    @seriesn said: To add individual subdomain level SSL - While generating SSL, you have an option to select whatever subdomain you want to install ssl for

    I found that too but it seems like the previous cert are overwritten. I might be wrong.

    @seriesn said: Auto www redirect sounds weird. Never seen that. Have you checked your domains .htaccess settings?

    This is my htaccess

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    

    You have a www redirect set on your htaccess file. That’s where the issue is :)

    I have dirty for that subdomain redirect too. Instead of adding a subdomain through subdomain management what I did was add a new domain via Domain Management and create subdomain.domain.com

    Why? Just why my man?

    I am now waiting again to make the changes take effect. How long usually DA check the new settings?

    It doesn’t take long at all and close to instant.

    PS: I am not really good with apache and similar webserver.
    I prefer nginx due to simplicity.

    It shouldn’t matter if you are on a shared host and has access to a control panel. It is what control panels are built for :)

  • @seriesn said: Why? Just why my man?

    yeah I know. It sucks. I call it dirty fix and so far it is working. My prime domain and it's subdomain now are down due to SSL error but one of subdomain that I created via Domain Management is working. I know it is funny and noob. :-(

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

    I thought this htaccess config is redirecting the domain.com to www.domain.com. Am I wrong? I found that when I googled around. :-(

  • @team_traitor said:

    @seriesn said: Why? Just why my man?

    yeah I know. It sucks. I call it dirty fix and so far it is working. My prime domain and it's subdomain now are down due to SSL error but one of subdomain that I created via Domain Management is working. I know it is funny and noob. :-(

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

    I thought this htaccess config is redirecting the domain.com to www.domain.com. Am I wrong? I found that when I googled around. :-(

    Why would you want to redirect to www?

  • @team_traitor said:

    @seriesn said: Why? Just why my man?

    yeah I know. It sucks. I call it dirty fix and so far it is working. My prime domain and it's subdomain now are down due to SSL error but one of subdomain that I created via Domain Management is working. I know it is funny and noob. :-(

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

    I thought this htaccess config is redirecting the domain.com to www.domain.com. Am I wrong? I found that when I googled around. :-(

    Your subdomain are created under the main domain. Which is why .htaccess is playing with your emotions.

    Domains gets their individual root files. Remove the faulty htaccess auto redirect and enjoy life :)

    Thanked by 1team_traitor
  • I also found that when you use OLS on DA, you HAVE to manually restart OLS every time you issue/change any SSL.

  • It is now okay guys.

    I am not sure what happened but when I use the option for generating SSL (letsencrypt) on DA I get an error saying failed to generate. Instead of using the DA's default method I use my local pc to generate one.

    What I did is create or generate the LE ssl on my local machine and pasted all the content into DA SSL Manager. It is working now.

  • Just a note: The 301 redirect is "permanent". A 302 redirect is temporary.

    When testing or making changes, use 302 so your browser doesn't cache it. If you had a 301 and made a change, you'd need to clear your browser cache to get the change. Therefore, it's best to use 302 until you're sure it's all working as intended.

    Depending on which LE cert generation used, if it was non-wildcard, it uses apache. So if the redirect was going to a different server, that could explain why LE wasn't able to generate the cert correctly. Would need more info/errors to know for sure, but at least it sounds like you got it working one way or another.

    Also thanks @seriesn for taking the time to post some expert guidance :)

    Thanked by 2seriesn team_traitor
  • @team_traitor said:
    It is now okay guys.

    I am not sure what happened but when I use the option for generating SSL (letsencrypt) on DA I get an error saying failed to generate. Instead of using the DA's default method I use my local pc to generate one.

    What I did is create or generate the LE ssl on my local machine and pasted all the content into DA SSL Manager. It is working now.

    You should ask your host to see what happened. That's unusual.

    Thanked by 1team_traitor
Sign In or Register to comment.