多个域的一个动态网站 [英] Multiple Domains to One Dynamic Site

查看:267
本文介绍了多个域的一个动态网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立了谁拥有多个用户/销售人公司网站,每个用户都需要自己的网站。我想做到的是建立一个网站动态拉在每个用户的信息。因此,我将建立一个网站,并在拉每个用户的信息动态。例如:

I am building a website for a company who has multiple users/sale people and each user needs their own website. What I want to accomplish is building one site that pulls in each users information dynamically. So i will build one site and pull in each users info dynamically. For example:

www.company.com/Mike
www.company.com/Steve
www.company.com/Jason

每个网址将随后在该特定用户的信息和内容使用会话cookie和URL变量拉动。然后,这将使得每个网址看起来像一个不同的网站虽然是同一部位用动态数据。我知道如何做到这一点,但我真的想做到的是让每个用户自己的域名。

Each url would then pull in that particular user's information and content using sessions, cookies and url variables. This would then make each url look like a different site although it is the same site with dynamic data. I know how to accomplish this but what i would really like to accomplish is giving each user their own domain.

我的问题是:我该如何让每个用户建立一个独特的域名,然后指向该域,来动态地拉在动态数据的网址:

My question is: How do I allow each user to set up a unique domain and then point that domain to the url that dynamically pulls in the dynamic data:

Mike.com --> www.company.com/Mike 
Steve.com --> www.company.com/Steve
Jason.com --> www.company.com/Jason  

我要做到这一点,并确保他们的网站是搜索引擎友好的就像一个独立的网站。我知道,我可以只转发网址,但我想的东西,更像一个实际的网站,是搜索引擎友好。

I want to accomplish this and make sure that their site is SEO friendly like a stand alone site. I know that i could just forward the url but i would like something that acts more like an actual site and is SEO friendly.

我建立这个在PHP,MySQL和JavaScript的。我运行LAMP服务器上的站点设置。感谢您的任何帮助。

I am building this in php, mysql and javascript. I am running the site on LAMP server set up. Thank you for any help.

推荐答案

如果您使用的是Apache,你可以使用mod_rewrite做重写。尝试添加到您的.htaccess文件:

If you are using apache, you can use mod_rewrite to do the rewriting. Try adding this to your .htaccess file:

# Match the host
RewriteCond %{HTTP_HOST} ^([^\.]+)\.com$ [NC]

# proxy the entire request to the /host/ and path
RewriteRule ^(.*)$ http://www.company.com/%1/$1  [L,P]

这将使它所以请求 http://Mike.com/page.html 将成为< A HREF =htt​​p://www.company.com/Mike/page.html相对=nofollow> http://www.company.com/Mike/page.html

This will make it so requesting http://Mike.com/page.html will serve http://www.company.com/Mike/page.html

这篇关于多个域的一个动态网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆