• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

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