[英]Ip address redirect to Domain name using .htaccess on shared hosting
[英]Redirect IP address to domain name in .htaccess
我正在尝试将IP地址重定向到我的网站的域名。 这是我的.htaccess文件:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^198\.50\.227\.185 [nc]
RewriteRule ^(.*)$ http://www.allrealfood.com/$1 [r=301,nc,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我不知道如何使它工作。
301(永久)重定向:
Redirect 301 / http://mt-example.com/
302(临时)重定向:将整个站点指向另一个临时URL。
Redirect 302 / http://mt-example.com/
将index.html重定向到特定的子文件夹:
Redirect /index.html http://example.com/newdirectory/
需要了解更多去这里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.