Setup: Ubuntu, Cyberpanel, OLS Webadmin
I have been trying to figure this out for a while, with AI no less, and still can't find a solution.
I have a WordPress multisite network with multiple second and third-level domains hosted with CyberPanel/OpenLiteSpeed. I have wildcard subdomains enabled and working for my second-level domains - *.example.com redirects to example.com properly.
However, subdomains under third-level domains like *.web1.example.com incorrectly redirect to the base domain, example.com. I need those to properly redirect to the second-level domain, web1.example.com.
Troubleshooting steps taken:
RewriteCond %{HTTP_HOST} ^(.+\.)?(.+)\. [NC]
RewriteRule ^(.*)$ https://%2%{REQUEST_URI} [R=301,L]
But any third level wildcard is redirected to the base url co.com for example.
I have even tried specifying the specific domain redirects to their base url and it still goes to co.com, de.com, uk.com and eu.com, respectively.
Potential causes could be conflicts with the general .htaccess rule, OLS configuration missing something for overlapping wildcards, or an issue between CyberPanel and OLS.
I would greatly appreciate if support could help identify the misconfiguration leading to this incorrect redirect behavior. Please let me know any debug steps or config details needed from my side.
Thank you! Any help is much appreciated.
I have been trying to figure this out for a while, with AI no less, and still can't find a solution.
I have a WordPress multisite network with multiple second and third-level domains hosted with CyberPanel/OpenLiteSpeed. I have wildcard subdomains enabled and working for my second-level domains - *.example.com redirects to example.com properly.
However, subdomains under third-level domains like *.web1.example.com incorrectly redirect to the base domain, example.com. I need those to properly redirect to the second-level domain, web1.example.com.
Troubleshooting steps taken:
- Added .htaccess redirect rules to preserve second-level domain
- AI says the following Servername block entries may resolve the issue but I don't know where to add in OLS Webadmin: <virtualhost> ServerName domain1.co.com ServerAlias *.domain1.co.com </virtualhost> or ServerName domain1.co.com ServerAlias *.domain1.co.com
- Tested behavior in incognito windows and with cached cleared
RewriteCond %{HTTP_HOST} ^(.+\.)?(.+)\. [NC]
RewriteRule ^(.*)$ https://%2%{REQUEST_URI} [R=301,L]
But any third level wildcard is redirected to the base url co.com for example.
I have even tried specifying the specific domain redirects to their base url and it still goes to co.com, de.com, uk.com and eu.com, respectively.
Potential causes could be conflicts with the general .htaccess rule, OLS configuration missing something for overlapping wildcards, or an issue between CyberPanel and OLS.
I would greatly appreciate if support could help identify the misconfiguration leading to this incorrect redirect behavior. Please let me know any debug steps or config details needed from my side.
Thank you! Any help is much appreciated.
Last edited: