全球主机交流论坛

标题: 拜年了!让子域名看起来象主域名的子目录结构 [打印本页]

作者: yunlife    时间: 2019-2-6 11:58
标题: 拜年了!让子域名看起来象主域名的子目录结构
本帖最后由 yunlife 于 2019-2-6 12:14 编辑

MJJ新年好,大家发财!
有点时间想玩玩,想建博客,用一个子域名装wordpress,另一个子域名装了typecho,但是子域名多看起来不好,对SEO也不好,所以想让子域名看起来象主域名的子目录结构,比如:
让实际建立的wp.my.com可以通过my.com/wp访问
让实际建立的type.my.com可以通过my.com/type访问
有什么好办法么?
站是UBUNTU + APACHE2

@hellfires:
你是搞笑的 啊,反向操作。。
别人都是实际my.com/wp 能通过wp.my.com访问,你反着来


因为考虑可能在另外一台服务器上也装NODEJS或者PYTHON或者GOLANG等的系统,所以仅仅装本服务器的子目录的方式不能支持多台不同服务器...
作者: 30826    时间: 2019-2-6 11:59
一个站有两个访问路径那怕是疯了……
还嫌SEO掉的不够快?
作者: tomcb    时间: 2019-2-6 12:00
这样对SEO就好么?
作者: yunlife    时间: 2019-2-6 12:00
30826 发表于 2019-2-6 11:59
一个站有两个访问路径那怕是疯了……
还嫌SEO掉的不够快?

闲着也是闲着,一起玩啊,春天到了,浪起来啊
作者: yunlife    时间: 2019-2-6 12:02
tomcb 发表于 2019-2-6 12:00
这样对SEO就好么?

所有的内容看起来不是像一个站的么?下次再装个JOOMLA,再装个....,每种类型的子站建了后都写点文章玩玩啊
作者: yunlife    时间: 2019-2-6 12:04
内存大,放着不是可惜了么?把各种流行的CMS都装个玩玩,一起浪啊
作者: yunlife    时间: 2019-2-6 12:05
域名转发可以做么? .htaccess有办法么?
作者: hellfires    时间: 2019-2-6 12:06
提示: 作者被禁止或删除 内容自动屏蔽
作者: yunlife    时间: 2019-2-6 12:12
hellfires 发表于 2019-2-6 12:06
你是搞笑的 啊,反向操作。。
别人都是实际my.com/wp 能通过wp.my.com访问,你反着来

因为考虑可能在另外一台服务器上也装NODEJS或者PYTHON或者GOLANG等的系统,所以仅仅装本服务器的子目录的方式不能支持多台不同服务器...
作者: 小明    时间: 2019-2-6 12:42
Open file: /etc/apache2/sites-enabled/000-default.conf

Or you can create a separate configuration file as you prefer I keep all my VHosts in one file. Once you have the configuration file open add new VHost configuration like so:

  1. <VirtualHost *:80>
  2.     DocumentRoot /var/www/subfolder
  3.     ServerName www.domain.com
  4.     ServerAlias domain.com
  5. </VirtualHost>
复制代码

Now go back to the folder: /etc/apache2 and open file: apache2.conf and add a new line:

ServerName www.domain.com

Save the file and restart your server using this command: service apache2 restart, the process is same across all OS the config folder locations tho can be different you can look those up.

---

以上是一个网站的方法,多个应该同理,复制粘贴,懒得打了
作者: t9913085    时间: 2019-2-6 13:52
这个不是很简单,手动绑定玉米就可以了




欢迎光临 全球主机交流论坛 (https://443502.xyz/) Powered by Discuz! X3.4