大网数据广告活动
网站运营与故障问答

Hosting multiple websites on one Synology server

· 52CE 我爱测

I am currently running one website where I host multiple "projects". One of these projects is now basically finished and I want to run this project on it's own domain. I am running my main website on my own Synology server and I …

问题原文

原帖链接 · Caseus · CC BY-SA 4.0

I am currently running one website where I host multiple "projects". One of these projects is now basically finished and I want to run this project on it's own domain.

I am running my main website on my own Synology server and I own a domain name for that site. I now want to buy a seperate domain for my new (finished) project. Since I only have one server at home I want to host both websites on that server. I had the following (probably terrible but I'm not sure) idea:

I put my finished project in its own seperate folder (with it's own index.php etc.) and I will link my newly bought domain name to my server. Then I check on my root index.php whether the user typed in "www.mainwebsite.com" in which case nothing happens, or if the user typed "www.seperateproject.com" I will redirect them to "finishedproject/index.php".

I am very certain that there are flaws in this system but It's the first (and easiest) thing that came to my mind. How will this e.g. influence my SEO?

I'm looking forward to hearing your opinions and if something is unclear, please let me know :)

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

To host multiple websites with multiple domain names on the same server you can use "virtual hosts." That is a feature where the web server looks at the domain name of the request, and chooses which directory contains the correct files based on that domain name.

Synology server supports the virtual host feature: https://kb.synology.com/en-in/DSM/help/WebStation/application_webserv_virtualhost

You would need to point the new domain to your server using A records.

When you implement virtual hosting, each website is available directly on its own domain name. That type of setup is better for both SEO and usabality compared to redirecting requests to a central domain.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2022-04-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。