How to redirect ip address to domain name in htaccess rewrite

hi guys I want to resolve my problem related to htaccess how to redirect ip address to domain name in htaccess rewrite
Deepak Sharma
Asked 15-11-2024
116

Answer (1)
hi friend use these line of code; RewriteCond %{HTTP_HOST} ^2\.2\.2\.2 RewriteRule (.*) http://example.com/$1 [R=301,L] Replace 2\.2\.2\.2 with your IPV4 ipaddress Replace http://example.com with your domain where you want to redirect; thanks
Ankur Rajput
Asked 23-11-2019
45 Likes
Comments
Write comment

Submit your answer