Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess CPanel上托管网站的IP规范化_.htaccess_Seo_Cpanel_Web Hosting_Whm - Fatal编程技术网

.htaccess CPanel上托管网站的IP规范化

.htaccess CPanel上托管网站的IP规范化,.htaccess,seo,cpanel,web-hosting,whm,.htaccess,Seo,Cpanel,Web Hosting,Whm,我已经使用WHM和Cpanel托管了我的网站, 并在.htaccess文件中添加了以下行 RewriteCond %{HTTP_HOST} ^103\.241\.144\.130 RewriteRule (.*) http://www.rockinexams.com/$1 [R=301,L] 现在,这个: http://103.241.144.130/~rockinex/ 重定向到www.rockingexames.com,但103.241.144.130没有。 我听说由于与cpanel体系

我已经使用WHM和Cpanel托管了我的网站, 并在.htaccess文件中添加了以下行

RewriteCond %{HTTP_HOST} ^103\.241\.144\.130
RewriteRule (.*) http://www.rockinexams.com/$1 [R=301,L]
现在,这个:

http://103.241.144.130/~rockinex/
重定向到www.rockingexames.com,但103.241.144.130没有。 我听说由于与cpanel体系结构相关的原因,这不起作用。
有什么方法可以实现吗?

如果该IP是共享IP,则您的规则将不起作用。对于这个规则,您需要一个专用的IP来访问http:YOUR-IP。您甚至可以尝试将~rockinex置于规则中,但我认为它不会起作用。

它不是共享IP,我有VPS。所以给定的IP是为我的网站专用的。但是这个IP是为你的网站设置的专用IP还是你的cPanel主IP?因为如果是cPanel主IP,则此IP是所有cPanel帐户的共享IP。这是cPanal主IP,因此您可以正确地认为它将为所有cPanal帐户共享。所以没有办法解决这个问题吗?如果你没有make的辅助IP作为专用IP,你唯一的尝试就是将~rockinex置于.htacces规则。好的,让我试试这个。将通知结果。