How to Redirect IP to Domain Name using .htaccess

It is important for the SEO to resolve your website and IP address to the same URL and duplicate content is not at all good for the SEO, and that is something you should fix it immediately.

In this Knowledgebase, I will guide how to fix it using .htaccess file:

You need to create an .htaccess file in the website's directory if not there, and add the following lines of code (replacing the IP and domain name with your own):

RewriteEngine On
RewriteBase /RewriteBase /
RewriteCond %{HTTP_HOST} ^12\.34\.56\.789$
RewriteRule ^(.*)$ http://www.yourdomainname.com/$1 [L,R=301]

After save the file and access your IP address manually to check if it is getting redirected to your domain name.

  • How to Redirect IP to Domain Name, IP to Domain Name, IP to Domain Redirect, Redirect IP request to Domain URL, Redirect IP to domain name, Redirect IP to domain name htaccess
  • 634 Kunder som kunne bruge dette svar
Hjalp dette svar dig?

Relaterede artikler

How to Update WHMCS Manually

1) Download the latest version of WHMCS from here: https://download.whmcs.com 2) Extract the zip...

How to Check TUN/TAP or PPP Enabled in the VPS/Server

  - To confirm TUN/TAP is enabled type “cat /dev/net/tun“. If you receive the message “cat:...

How to Check TUN/TAP or PPP Enabled in the VPS/Server

  - To confirm TUN/TAP is enabled type “cat /dev/net/tun“. If you receive the message “cat:...

How to Check TUN/TAP or PPP Enabled in the VPS/Server

  - To confirm TUN/TAP is enabled type “cat /dev/net/tun“. If you receive the message “cat:...

How do I order additional IP addresses?

  HostNamaste offers additional IPs with valid justification as per ARIN / APNIC / RIPE...