• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • 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.

old problem: subdomain with www - almost solved

HMnet

Basic Pleskian
old problem: subdomain with www - SOLVED

Hi @all!

I have this old problem: I want to create a subdomain with www. in front of it.

I use Plesk 7.5.3 with SuSe 9.1.

I tried to use DNS settings, but that doesn't really function. As anyone knows. :)

So I testet the version with the vhost.conf file.

This is my vhost.conf:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteMap lowercase int:tolower
ServerAlias www.<sub>.<domain>.com
RewriteCond %{HTTP_HOST} ^www.<sub>.<domain>.com$
RewriteCond %{REQUEST_URI} !^/home/httpd/vhosts/<domain>/subdomains/<sub>/httpdocs/
#RewriteCond %{REQUEST_URI} !error_docs
RewriteRule (.*) /home/httpd/vhosts/<domain>/subdomains/<sub>/httpdocs/$1
</IfModule>

OK. The browser opens the right site, but PHP is disabled. So the browser wants to download the *.php files.

:eek:

Has anybody a solution for that problem?

Thanx!

HMnet
 
SOLVED!

Hi!

I just figured it out :D.

For anyone who is interested in:

Add the following syntax in your vhost.conf file and you will have a ServerAlias www.<sub>.<domain>.com for your subdomain:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteMap lowercase int:tolower
ServerAlias www.<sub>.<domain>.com
RewriteCond %{HTTP_HOST} ^www\.<sub>\.<domain>\.com$
RewriteRule ^/(.*) http://<sub>.<domain>.com/$1 [L,R]
</IfModule>

OK, that's it.

HMnet :cool:
 
Yeah, thank you!

Had one customer complaining about the www-before-subdomain-problem today.
This fix made the problem go away easy :)
 
Back
Top