同一台服务器上的两个不同的 WordPress 博客可以使用公共主题文件夹吗? [英] Can two different WordPress blogs on the same server use a common theme folder?

查看:30
本文介绍了同一台服务器上的两个不同的 WordPress 博客可以使用公共主题文件夹吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个 WordPress 博客在同一台服务器上运行,因此它们都可以访问相同的文件系统.两个博客使用相同的模板,并且这个模板在每个主题目录中都是重复的.每次更新主题时,我都需要将新文件复制到两个主题目录中.

I have two WordPress blogs running on the same server, so they both have access to the same file system. Both blogs use the same template, and this template is duplicated within each theme directory. Every time that I update the theme I need to copy over the new files to both theme directories.

是否可以让这两个博客共享一个公共主题目录,以便我只需要修改一个模板文件夹?

Is it possible to have both of these blog share a common theme directory so that I only need to modify one template folder?

推荐答案

绝对可以.只需确保他们对该共享文件夹具有读写权限即可.

Absolutely. Just make sure that they have read and write access to that shared folder.

然后从每个主题文件夹设置一个符号链接.你可以用 ln -s 来做到这一点.<新>

Then set up a symlink from each of the theme folders. You do this with ln -s <origin> <new>

如果你不能使用符号链接,那么你可以设置一个重写规则,它将所有来自 /wp-content/themes 的请求重定向到 /var/www/共享/主题.

If you can't use symbolic links, you can then set up a rewrite-rule, which redirects all requests from /wp-content/themes to like /var/www/shared/themes.

如果你愿意,我可以提供一个例子.

If you want, I can provide an example.

这篇关于同一台服务器上的两个不同的 WordPress 博客可以使用公共主题文件夹吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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