Subdomain routing issues

Ch3vr0n

Verified User
Joined
Aug 24, 2014
Messages
23
After updating DA to the latest build 1.59.5 new subdomains behave strangely

One of my clients' subdomain is behaving strangely.

dev.domain.tld only works in http mode, while a valid certificate is issued by let's encrypt. The problem is when trying to access https://dev.domain.tld it redirects to https://www.dev.domain.tld/dev/ for some weird reason (by the looks of it, it's looking for a dev folder inside the dev folder created by the subdomain on the site root)

any attempt to call any file on the dev directory (client is trying to install joomla) redirects to http://www.dev.domain.tld/dev/

Client is stuck and cannot move forward with installing the joomla cms on the subdomain for development purposes. Tried creating multiple subdomains with the same result.

Oddly enough another client created a subdomain on dev.domain2.tld about a week before updating DA which works just fine . That client was asked to create another which "behaves" fine but also results (as <domain.tld> client) in error 403 forbidden.
 

Ch3vr0n

Verified User
Joined
Aug 24, 2014
Messages
23
Still not fixed here, but i did find a workaround.

Instead of going through "subdomain management", use "domain setup", and add the subdomain you want as a full domain (and it'll behave as such). You just need to make sure then that you have a valid A record in your dns configuration. In my case there's a wildcard record

A *.domain.tld

Though obviously this needs fixing
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
hm, okay I 'll do it now.
by the way, what about 406 not acceptable nginx anytime if trying to update WordPress page fro directory.
 

Ch3vr0n

Verified User
Joined
Aug 24, 2014
Messages
23
Don't know, don't care. That's not even remotely relevant to this issue. Subdomain routing issue isn't linked to either nginx, nor wordpress. Please stay on topic
 

ikkeben

Verified User
Joined
May 22, 2014
Messages
653
Location
Netherlands Germany
Don't know if changed somethig with which updates in time.

But i was alway doing creating subdomains as own create domains, it was long time ago a advice here in forum to sofar i remember.

This for problems some having with paths / docroot. cms whatever...

Please correct me if i'm writing buls... now. ;)
 

Ch3vr0n

Verified User
Joined
Aug 24, 2014
Messages
23
Obviously something changed in the 1.59.5 build or i wouldn't have created this topic. Didn't happen in 1.59.0 i always created them through the subdomains function, why else would that function be there. But this is a good workaround until this gets resolved
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
dev.domain.tld only works in http mode, while a valid certificate is issued by let's encrypt. The problem is when trying to access https://dev.domain.tld it redirects to https://www.dev.domain.tld/dev/ for some weird reason (by the looks of it, it's looking for a dev folder inside the dev folder created by the subdomain on the site root)

i have the same issue.

my website works like this: site.com/subdomain but not works like this subdomain.site.com
 

Active8

Verified User
Joined
Jul 13, 2013
Messages
232
You just need to make sure then that you have a valid A record in your dns configuration.
e.g. subdomain A (IPSERVER SERVER)

my website works like this: site.com/subdomain but not works like this subdomain.site.com
 

Ch3vr0n

Verified User
Joined
Aug 24, 2014
Messages
23
@Active8

A valid A record here is irrelevant. This routing problem didn't happen in version 1.59 regardless of a valid subdomain record or not

create subdomain in 1.59 using the subdomain option: subdomain.site.tld properly opened AND STAYED in the browser as subdomain.site.com. regardless of http or https
Post 1.59.5 update: http://subdomain.site.tld behaves properly, access https://subdomain.site.tld and you get redirected to https://www.dev.domain.tld/dev which results in error 403 forbidden.

Something in the routing got screwed up for https requests for subdomains period. And this needs fixing, end of story.
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
my website works like this: site.com/subdomain but not works like this subdomain.site.com

i do have valid nameservers and valid A record.

intodns.com/likeakinginc.com

ns1.likeakinging.com
ns2.likeakinginc.com

Webserver DA: 104.237.9.154

ns1: 104.237.10.55
ns2: 104.251.210.36

A Record for ( Sub Domain - SRV ) - 104.237.9.154 Screenshot: https://prnt.sc/q68gan


Sub Domain srv.likeakinginc.com Broken Screenshot: https://prnt.sc/q68hdq
Sub Domain likeakinginc.com/srv Working Screenshot: https://prnt.sc/q68hxg
 
Last edited:

bdacus01

Verified User
Joined
Jul 22, 2017
Messages
581
Location
Murfreesboro
This?
If you have a separate WordPress install in the root directory, then the .htaccess files of your subdirectory will cause conflict. This will result in 404 errors on your website.

To solve this, you need to edit the .htaccess file in your subdirectory WordPress install. Replace the code inside your .htaccess file with the following code:
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /your-subdirectory/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /your-subdirectory/index.php [L]
</IfModule>

# END WordPress
Don’t forget to replace /your-subdirectory/ with your own subdirectory name.
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
This?
If you have a separate WordPress install in the root directory, then the .htaccess files of your subdirectory will cause conflict. This will result in 404 errors on your website.

To solve this, you need to edit the .htaccess file in your subdirectory WordPress install. Replace the code inside your .htaccess file with the following code:
Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /your-subdirectory/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /your-subdirectory/index.php [L]
</IfModule>

# END WordPress
Don’t forget to replace /your-subdirectory/ with your own subdirectory name.
I appreciate your help.

still the same no effect.

I don't know but i got fellings its supposed to be something ModSecurity rule set
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
Thanks, and it is what we do here. This community cares so we help.

Well test out your theory and turn off mod security.
I did turn it off but still the same no effect at all :(
almost 2 weeks its drives me crazy I read a thousand pages of google also :) so many different thinks but no results.
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
I did reinstalled 2nd webserver all-new, reinstalled OS and reinstalled DA but still the same.
its the same issue on my 2nd webserver.

I did back up and restore on this one but after that almost reinstalled this one too. but 2nd server is clean and free from 0 to 100 and have the same error on a sub domain
 
Top