如何将所有指向源站的域名重写为我的域名?我想阻止其他域名托管我的内容!
发布于 2017-09-27 16:45:39
嗨,伙计们,这对任何有问题的其他域名的人都有帮助,指向那里的原始IP,并且索引比他们更高,等等!你需要做的第一件事
是确保在httpd.conf文件中启用了mod_rewrite.so模块
Include conf.modules.d/*.conf
LoadModule rewrite_module modules/mod_rewrite.so您还必须确保允许.htaccess文件覆盖所有:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All一旦完成此操作,您可以设置一个301永久重定向-所以在我的示例中,您需要做的就是设置forwader“www”。"yourdomain.com“,并将其转发给"yourdomain.com”的重写。您可以在DNS管理器的页面设置中执行此操作,或者在重写条件下将此代码复制到.htaccess文件中。
Options FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS_HOST} !^https://yourdomain.com$
RewriteRule ^/?(.*) https://www.my-domain.com/$1 [QSA,R=301,L]现在你可以看到,我已经为https:// connections设置了一个重写--如果你想重写http,只需要去掉S,这样就是第四个!
我的问题是,我现在根本不知道如何阻止我的"targetdomain.com“能够访问我的原始数据!
https://stackoverflow.com/questions/46443329
复制相似问题