• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Redirect root domain and all wildcard subdomains to specific subdomain

molmagman

New Pleskian
Here is my problem.

Say I have a domain bestwebsite.com but I want all traffic to redirect to the.bestwebsite.com, even from the root domain. This is the company name.
I have set up one subscription for bestwebsite.com with a wildcard SSL certificate.
I can make bestwebsite.com redirect to the.bestwebsite.com using the following .htaccess file...

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^the\.bestwebsite\.com$ [NC]
RewriteRule ^(.*)$ https://the.bestwebsite.com/$1 [R=301,L]

...but my site is hosted in a subscription for bestwebsite.com so the.bestwebsite.com is not found and redirection from anything other than the root domain does nothing :(

BTW - bestwebsite.com is not my real domain :)

I'm using Plesk Obsidian on a VPS from IONOS but I have access to the DNS settings and file system.
 
Maybe the Rewrite is unnecessarily difficult for what you wish to achieve. You could put
Code:
Rewrite 301 / https://the.bestwebsite.com/
into your .htaccess file to redirect all.
 
Maybe the Rewrite is unnecessarily difficult for what you wish to achieve. You could put
Code:
Rewrite 301 / https://the.bestwebsite.com/
into your .htaccess file to redirect all.
Wouldn't that result in a redirect loop?
 
When the user puts the code into his main domain, it will simply redirect to the subdomain. The subdomain is not affected by it. Unless however, the user has created the document root directories of his subdomain branching off the document root directory of his main domain. But the default configuration is that each domain and subdomain has their own subdirectory branching off the user's home.
 
Back
Top