php - How to route sub-domains to account pages? How does domain masking work? -
part 1
I want to create a PHP Zend Framework application that sign up to use the user can do. When they register, I would like to apply to create a sub-domain which points to their public page, which provides specific content for that client.
For example: or
Update: is a good tutorial which uses a lot of answers to this question on this question. .However, I'm still thinking ...
Question # 1: Wildcards sub-domains in the tutorial. Is it necessary to achieve this? Is there any way to use wildcard subdomain?
Part 2
I will need to provide the user the ability to register the domain name and point to their page. So if you wanted to go, you would be looking, but you will never be able to tell because the URL in the address bar shows. Does this make any sense? I think this process is called domain masking. I want to offer free domain masking to my users.
Update: I've just discovered the domain of domain reseller API. feels good. Do you have a suggestion?
Question # 2: How does domain masking work? Can this domain work with the Reseller API?
You solved any part of your question for Part 1 - but I'm not sure Required - you will not do a different job for each site - you want to load different content depending on the URL. We handle this in a simple way:
- You must capture the server URL in your bootstrap.php
- Take the URL and http: // and before .mywebapp .com
- Find this prefix in a database table and load any information about the user or other information to do this prefix
- Add an object to Zend_Config You can access the site details from any page (we call this siteinfo ).
- Modify your controllers or scenes to react differently depending on siteinfo- that is Change what data they retrieve
You will need to modify Apache to handle it - and the easiest way is to ensure that your default domain (when a URL is recognized Not being) is set on your application.
DNS changes are not easy to handle - you must be a DNS server that can handle the wildcard answer.
Part 2: I think you are saying that if I enter the URL that will redirect it, it updates me to grouchal.com for existing DNS server entries You will need to do so to find your server.
If you want to see a good example of this work in practice then you should set up a Google app for your domain account. I have URLs like mail.grouchal.com which are once typed in mail.google.com/a/grouchal.com I need to set up the grouchal.com DNS server to point it to a Google server. Google server then puts a redirect so that the URL changes according to the need.
I am going back to the above proposed solution so that you can modify it, when there is a name besides checking the prefix for your domain (i.e. extracting the pupp out), this optional domain will also be seen . Therefore, if there is no mywebapp.com in the address, then this database will appear on grouchal.com and then using that data, the site will set the interface.
Hope this makes sense - you have problems with PHP but to install your Whitelat DNS server and configure your DNS server correctly to your customers. Although good fortune with the project
Comments
Post a Comment