Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I searched stackoverflow and google before posting this question.

I am developing a PHP/MySQL based dynamic conference website. Where users can register and create their own events for conference. Currently I have unique URL for each event and used .htaccess for that.

For example:

http://www.mydomain.com/event_name_1

http://www.mydomain.com/event_name_2

http://www.mydomain.com/event_name_3

Problem:

Now I want to change above implementations. Instead of using mydomain.com in URL I want to give users a feature where they can enter their own domain while using same code and database available on my server.

For example:

http://www.myclientdomain.com should run http://www.mydomain.com/client_event_name

I am not looking for code examples, I need directions what are possible options, is it possible or not.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You're not trying to do anything too special, and it's definitely possible. The way in which this is generally achieved is as follows:

You configure a subdomain which is designed for receiving visitors redirected from an external domain. For example, external.mydomain.com. The page on the end of this will look at the headers and query the database to decide where to redirect to. If a user attempt to access directly, the page should return a 404, another error or redirect to your home page.

The user configures their domain (or subdomain, whatever) with a new CNAME record of external.mydomain.com

And finally, to prevent account hijacking, your service will normally generate some kind of verification code which the user adds as a TXT record.

This is exactly how Google do it for Google Apps.

share|improve this answer
    
There is no automatic way to achieve this? Means any API, as normally my clients are not technical enough to configure their domains. –  Irfan DANISH Jul 1 '13 at 10:05
    
Not really - you have no way of knowing what DNS service they're using and if it were possible, it would almost certainly be more complicated to set up their side than simply adding 2 DNS entries. –  Dan Jul 1 '13 at 10:34
    
@IrfanDANISH Feel free to mark this as the answer ;) –  Dan Jul 2 '13 at 11:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.