确保网站无法从主机迁移的代码段?
请注意,我的意图没有恶意。我的意图源于我自己和我正在努力执行的客户之间的合同问题。
我可以做些什么 - 通过 PHP、.htaccess、MySQL 或其他方式 - 这将确保(在相当程度上) WordPress 网站很难迁移到不同的主机吗?
我完全理解,精通 PHP、MySQL 和 WordPress 的人可能能够找到解决方法,但我需要一个简单的解决方案,以确保客户无法通过 FTP 压缩他的 WordPress 应用程序、导出数据库并迁移它到一个新的主机。
限制对 MySQL 管理员和根 FTP 的访问不是一个选项。
感谢您的帮助!
Please note, my intention here is not malicious. My intentions stem from contractual issues between myself and a client that I am working to enforce.
Is there anything I can do - via PHP, .htaccess, MySQL or otherwise - that will ensure (to a decent extent) that a WordPress site would be difficult to migrate to a different host?
I completely understand that someone extremely well-versed in PHP, MySQL and WordPress might be able to find a workaround, but I need an easy solution that will ensure a client cannot zip up his WordPress app via FTP, export the database, and migrate it to a new host.
Restricting access to the MySQL admin and the root FTP is not an option.
Thanks for all your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
真的很安全-不。正如您所说,任何精通 PHP 的人都可以解决大多数限制。
半途而废,对于一个不精通的人来说是不可能工作的——有点。您需要确定一些在服务器切换时会发生变化的参数 - 例如,目录结构或服务器的 IP(位于
$_SERVER["SERVER_ADDR"]
变量中)。还有其他变量和参数 - 执行
phpinfo()
以获得概述。Really securely - no. As you say, anyone a bit versed in PHP can work around most restrictions.
Halfway decently, impossible for a not-well-versed person to work around - kind of. You'd need to identify some parameter that is going to change if servers are switched - for example, the directory structure, or the server's IP, which is in the
$_SERVER["SERVER_ADDR"]
variable.There are other variables and parameters as well - do a
phpinfo()
to get an overview.您需要知道当前服务器上 $_ENV['HOSTNAME'] 的值,但是一旦您知道这一点(并且可以验证它不会明显改变),您可以使用以下命令编辑 wp-blog-header.php 文件第 7 行如下:
我声明在 wp-blog-header.php 中执行此操作的原因是因为如果我要查看如何解决此问题,我会查看 index.php 或主题文件。
You'll need to know the value of $_ENV['HOSTNAME'] on your current server, but once you know this (and can verify it's not going to change obviously) you could edit the wp-blog-header.php file with the following on line 7:
The reason I state to do this in wp-blog-header.php is because if I were going to look on how to fix this, I would look in index.php or the theme files.