简体   繁体   English

将网站从一个域克隆到另一个域

[英]Clone a website from one domain to another

What would be the best approach for the following.... 什么是以下最佳方法?

Website 1 - has 300+ individual .html product pages (no database involved) 网站1-拥有300多个单独的.html产品页面(不涉及数据库)

The products/content from Website 1 need replicating on Website 2, Website 3, Website 4 and Website 5. 来自网站1的产品/内容需要在网站2,网站3,网站4和网站5上复制。

Each site is location based eg glossop-bikes.co.uk, buxton-bikes.co.uk, hyde-bikes.co.uk etc. 每个站点都是基于位置的,例如,glossop-bikes.co.uk,buxton-bikes.co.uk,hyde-bikes.co.uk等。

I have 3 main questions.. 我有3个主要问题。

1) How would I achieve such a thing without having to manually recreate every single page on each 5 sites? 1)我将如何实现这样的目标而不必手动在每5个站点上重新创建每个页面?

2) How would I avoid duplicate content issues?, because the products will be identical just in a different location. 2)我将如何避免重复的内容问题?因为产品在不同的位置将完全相同。

3) Would it be possible to change the product details/price etc once and then it updates on all 5 sites? 3)是否可以一次更改产品详细信息/价格等,然后在所有5个站点上进行更新?

Thanks for you help 谢谢你的帮助

Dan

EDIT: 编辑:

The main purpose of the sites are to target a niche in each geographical area, so say someone types 'bikes glossop' they will find the glossop site first etc. 这些网站的主要目的是针对每个地理区域的利基市场,因此,如果有人输入“ bikes glossop”,他们将首先找到glossop网站。

Each site will have 60/70% similar text/copy but the key stats for each product would ideally be updated via one cms. 每个站点将有60/70%的相似文本/副本,但理想情况下,每个产品的关键统计信息将通过一厘米进行更新。 Could this be done via an existing CMS like Joomla, Silverstripe, wordpress or would it have to be a bespoke php job? 可以通过现有的CMS(例如Joomla,Silverstripe,wordpress)完成此操作,还是必须进行定制的php工作?

Does this make my issue clearer? 这使我的问题更清楚了吗?

1) Unless I'm misunderstanding, can't you just upload all the pages to different sites (ie different folders in the FTP)? 1)除非引起我的误会,您能否将所有页面都上传到不同的站点(即FTP中的不同文件夹)? If you're changing, say, the site titles you could use Notepad++ to do a search/replace across all the pages, ie replace "Glossop Bikes" with "Buxton Bikes", but that won't be totally reliable. 举例来说,如果您要更改站点标题,则可以使用Notepad ++在所有页面上进行搜索/替换,即用“ Buxton Bikes”替换“ Glossop Bikes”,但这并不完全可靠。

2) If you are just copying the sites exactly, or just changing a few words here and there, then yes, search engines will see it as duplicate content. 2)如果您只是复制网站,或只是在此处和此处更改几个单词,那么是的,搜索引擎会将其视为重复的内容。 It's possible you could get penalized if the sites are all on the same server. 如果这些站点都在同一服务器上,则可能会受到处罚。 (Usually though, Google just takes whatever it thinks is the "original" page and displays that instead of the others.) (不过,通常情况下,Google只会采用其认为是“原始”页面的内容,而不显示其他页面。)

3) Not easily on a static site - you could do the search/replace thing again I guess. 3)在静态站点上不容易-我猜您可以再次执行搜索/替换操作。 It's difficult even with a dynamic site - you'd have to make the changes on one site and copy the database tables over. 即使是动态站点也很难-您必须在一个站点上进行更改并复制数据库表。

One other solution would be to first point all sites at the same database. 另一种解决方案是首先将所有站点指向同一数据库。 Then use some kind of language system to replace key text. 然后使用某种语言系统替换关键文本。 For example you would have a file containing variables for that site, eg $sitename = 'Glossop Bikes'; 例如,您将拥有一个包含该站点变量的文件,例如$sitename = 'Glossop Bikes'; . In your code for the pages you would then reference the variables any time you wanted to put the site name. 在页面代码中,您随时可以在要放置站点名称时引用变量。 And you create a different language file for each site. 您为每个站点创建一个不同的语言文件。

2) You choose one page to become the "primary" and add the canonical attribute to the other pages to point to the primary page. 2)您选择一个页面成为“主要”页面,并将规范属性添加到其他页面以指向该主要页面。

For example, this very page contains this instruction: 例如,此页面包含以下说明:

<head>
    <link rel="canonical" href="http://stackoverflow.com/questions/1674188/clone-a-website-from-one-domain-to-another">
</head>

This way search engines will know which page to focus on and give the rank to while other will be considered as alternative routes to it. 这样,搜索引擎将知道要关注的页面并给出排名,而其他页面则被视为到达该页面的替代路线。

除非我误解了您要做什么,否则您需要将所有域都放在同一服务器上,并且所有域都指向同一文件夹。

This is easily doable - even with different skins / header graphics for each site - eg using some PHP, but it sounds like a bad idea, mainly because of the duplicate content issue. 这很容易做到-即使每个站点使用不同的外观/标题图形-例如使用一些PHP,但这听起来也不是一个好主意,主要是因为存在重复的内容问题。 If you don't mind me asking, what is your reason for doing this? 如果您不介意我问,您这样做的原因是什么? Is it a management decision? 这是管理决定吗? Would a simple redirect to one central site not be the better way? 简单重定向到一个中央站点不是更好的方法吗?

I'll try and elaborate on DisgruntledGoat's option that I think is the best. 我会尽力说明我认为最好的DisgruntledGoat的选项。

You say there are 300 pages on that site and you want other sites to have basically the same pages, with basically the same content. 您说该站点上有300个页面,并且您希望其他站点具有基本相同的页面,并且具有基本相同的内容。 My strategy would be the following. 我的策略如下。

  1. Parse all the existing html files and separate out the parts that are similar across domains. 解析所有现有的html文件,并分离出跨域相似的部分。 You put those parts in a database. 您将这些零件放在数据库中。
  2. Make a template for every domain. 为每个域制作一个模板。
  3. Per domain, call the domain-specific template and fill it in by calling the domain-IN-specific content (like texts and prices) from the database. 对于每个域,调用特定于域的模板,并通过从数据库中调用特定于域的IN的内容(例如文本和价格)来填充它。

If you want to update domain-IN-specific content, you do that in the database, then it gets updated in all the sites. 如果要更新特定于域的内容,请在数据库中执行此操作,然后在所有站点中对其进行更新。 If you want to change domain-specific content, change it in the template for that domain. 如果要更改特定于域的内容,请在该域的模板中进行更改。

SEO point - just FYI: changing one keyword (eg locality name) will mean you are having duplicate content as seen by google. SEO点-仅供参考:更改一个关键字(例如,地区名称)将意味着您拥有重复的内容(如Google所见)。 so i wouldn't really recommend doing what you propose. 所以我真的不建议您做建议。 instead try to write more info about the locality itself (eg description of the city, basic facts etc.) and combine it with the bike-related keywords - that would help you much more. 而是尝试编写有关位置本身的更多信息(例如,城市描述,基本事实等),并将其与与自行车相关的关键字结合在一起-这样可以为您提供更多帮助。

What I would do is, each of the 300+ products has it's own .html page, that page contains just the information relative to the product. 我要做的是,这300多种产品中的每一个都有自己的.html页面,该页面仅包含与产品有关的信息。 All the branding and theming will be separated files (footer, header, menu, css), one set of files per website. 所有品牌和主题将是单独的文件(页脚,页眉,菜单,css),每个网站有一组文件。

Then with PHP just glue the pieces together. 然后使用PHP将各个部分粘合在一起。 The content of each product can be pulled from the .html file by doing either: 可以通过以下任一方法从.html文件中提取每种产品的内容:

$content = file_get_contents("http://website1.co.uk/products/$productnumber.thtml");

or ("more risky") 或(“更具风险性”)

include("http://website1.co.uk/products/$productnumber.thtml");

You can pass around $productnumber in the query (ie ?productno=1) or have apache create some nice routes for you with mod_rewrite. 您可以在查询中传递$ productnumber左右(即?productno = 1),或者让apache使用mod_rewrite为您创建一些不错的路由。

I've done this kinda thing before, and we pulled it with that and buffered output . 我以前做过这种事情,我们用它拉了它并缓冲了输出 Which lets you "pre-process" the htmls before you spit it out and do any search/replaces needed. 这样一来,您就可以在对HTML进行“预处理”之前将其吐出并进行所需的任何搜索/替换。

We couldn't use DB for that project, they already had tonnes of .html's. 我们无法在该项目中使用DB,因为他们已经有大量的.html。 DB sounds THE most logical answer. DB听起来是最合乎逻辑的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将magento网站从一个域转移到另一个域 - transfer magento website from one domain to another 将页面从一个域重定向到另一个域(两个域都属于一个网站) - Redirect a page from one domain to another domain (both domains belong to one website) 在一个域上运行网站前端,在另一个域上运行网站后端 - Run front end of website on one domain and backend of website on another domain CodeIgniter 在将网站从一个域迁移到另一个域并托管时未加载 CSS 和 JS - CodeIgniter not loading CSS and JS while migrating website from one domain to another domain and hosting 如何计算来自另一个网站(完全不同的域)的一个网站的访问者 - How to count visitor of one website from another website(which are on totally different domain) 从一个域上另一个域上载文件 - Upload files from one domain on another domain 需要从一个域转移到另一个域 - Need to transfer from one domain to another domain 使用其他域的功能保护网站 - Protect website by using function from another domain Wordpress错误 - 抱歉,您无权访问此页面。 将网站从一个域迁移到另一个域后 - Wordpress error - Sorry, you are not allowed to access this page. After migrating website from one domain to another 从同一域中的另一个网站登录laravel网站 - Login to laravel website from another website on same domain
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM