Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

how to assign a custom domain to each customer without sharing code

I am providing a service on following url

http://www.mydomain.com/live/agent/index.php?user_name=david ## home page
http://www.mydomain.com/live/agent/blog.php?user_name=david ## blog
http://www.mydomain.com/live/agent/view_blog.php?user_name=david&blog_id=10 ## blog details page

Now i want that if a username register a website as http://www.davidwebsite.com 

http://www.davidwebsite.com/blog should actually get request from http://www.mydomain.com/live/agent/blog.php?user_name=david and i don't have to share my source code  with every customer's domain and hosting.

Any solution ???
0
birwin
Asked:
birwin
1 Solution
 
dpearsonCommented:
I think you may want to look into apache's "rewrite" rules, which allows you to take a request in a specific format and rewrite it to your service.

You'd run the rewrite logic on the davidwebsite.com domain(s) and it would redirect the requests to your mydomain.com service - where you one copy of the source code to do the work would live.

Details on configuring apache rewrite rules are here:
http://httpd.apache.org/docs/current/rewrite/

Hope that helps,

Doug
0
 
arnoldCommented:
You would configure virtual host entry on your server to respond to the request based on www.someotherdomain.com
The difficulty deals with your need is for /blog.
I.e. Your best bet is to use blog.someotherdomain.com to point to your server using a CNAME and your httpd.conf or conf.d/someotherdomain.conf will have the site definition.

You may have to use apache proxy configuration as well.
0
 
birwinAuthor Commented:
This was not the solution to my situation. There are problems using forms.

I have been asked to close this question.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now