• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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