Hello,
I need some help with a problem of Virtual Subdomains vs. Real Subdomains:
Setup:
- dedicated Server at 1and1 with CentOS and Plesk 10.02
- Domain: example.com
- real Subdomain: blog.example.com (created via Plesk)
- PHP system running in main domain example.com (httpdocs folder)
- PHP system allows user to create user specific website with URL user.example.com
- request for user.example.com is redirected via Wildcard to php system in httpdocs folder
- Wildcard created via A-Record (*.example.com) and Vhost.conf (ServerAlias *.example.com)
Example:
User Donald creates his website with URL http://donald.example.com. The request for the subdomain is processed correctly, reaching the php system that returns the website.
Problem:
The real subdomain blog.example.com is processed like just another virtual subdomain, reaching the php system. But it should redirect to the subdomain/blog/httpdocs folder!
Questions:
a) Some sources claim that the Wildcard-A-Record (*.example.com) will be processed if no other DNS record (like the blog-A-Record blog.example.com) matched the request. Some people just claim the opposite. Can anybody confirm the order of processing DNS records?
b) Looking at my httpd.include I found the virtual host entry for the blog.example.com below the virtual host entry for example.com:80 and example.com:443. The example.com:80 is showing the <include> of the *.example.com. That way the *.example.com catches any request already before the blog.example.com is processed. Changing the order of the httpd.include entries manually will be overwritten by plesk. How can I change the order inside the httpd.include then?
c) Some sources suggest to create a ZZZ_Wildcard subdomain as a catch-all. However, the zzz_wildcard would redirect to the subdomains/zzz_wildcard/httpdocs folder. But my PHP system needs to run in the principal httpdocs folder. Is there a chance to redirect form the subdomains/zzz_wildcard/httpdocs folder to the principal httpdocs folder via .htaccess?
d) Any other idea of how to use virtual subdomains and real subdomains at one domain?
Any idea will be highly appreaciated as I already read through more than a hundred blog posts and pages without any of the suggested solutions solving my problem.
Thanks,
Mike
I need some help with a problem of Virtual Subdomains vs. Real Subdomains:
Setup:
- dedicated Server at 1and1 with CentOS and Plesk 10.02
- Domain: example.com
- real Subdomain: blog.example.com (created via Plesk)
- PHP system running in main domain example.com (httpdocs folder)
- PHP system allows user to create user specific website with URL user.example.com
- request for user.example.com is redirected via Wildcard to php system in httpdocs folder
- Wildcard created via A-Record (*.example.com) and Vhost.conf (ServerAlias *.example.com)
Example:
User Donald creates his website with URL http://donald.example.com. The request for the subdomain is processed correctly, reaching the php system that returns the website.
Problem:
The real subdomain blog.example.com is processed like just another virtual subdomain, reaching the php system. But it should redirect to the subdomain/blog/httpdocs folder!
Questions:
a) Some sources claim that the Wildcard-A-Record (*.example.com) will be processed if no other DNS record (like the blog-A-Record blog.example.com) matched the request. Some people just claim the opposite. Can anybody confirm the order of processing DNS records?
b) Looking at my httpd.include I found the virtual host entry for the blog.example.com below the virtual host entry for example.com:80 and example.com:443. The example.com:80 is showing the <include> of the *.example.com. That way the *.example.com catches any request already before the blog.example.com is processed. Changing the order of the httpd.include entries manually will be overwritten by plesk. How can I change the order inside the httpd.include then?
c) Some sources suggest to create a ZZZ_Wildcard subdomain as a catch-all. However, the zzz_wildcard would redirect to the subdomains/zzz_wildcard/httpdocs folder. But my PHP system needs to run in the principal httpdocs folder. Is there a chance to redirect form the subdomains/zzz_wildcard/httpdocs folder to the principal httpdocs folder via .htaccess?
d) Any other idea of how to use virtual subdomains and real subdomains at one domain?
Any idea will be highly appreaciated as I already read through more than a hundred blog posts and pages without any of the suggested solutions solving my problem.
Thanks,
Mike