Wordpress shows on IP and Domain Name after droplet install


I setup a wordpress blog using the 1-click install method, everything works great however my blog shows on both my domain & my IP which isn’t good for SEO (duplicate content). Do I need to edit my apache settings in order to redirect the IP to the domain? (if so… how!)


From what you are describing that is not actually duplicate content. It is just 2 ways to the same content. You domain resolves to your ip number after the browers or bots checks with a dns server.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

like @kely says it isn’t duplicate content however it does affect your SEO score once people join your website by IP (wich is most likely not going to happen since its alot more difficult). However you can have the google crawlers to change this IP to the domain name with a 301 redirect and as well have people redirected properly. For this you need to edit your apache VHOST / .htaccess . Make sure the 000-default.conf has AllowOverride All set for the wordpress directory, if you didn’t change this then it should be set on default. Now you want to create a .htaccess file inside the directory of wordpress ( default /var/www/html ) with the following:

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

You need to replace the IP and domain to your own setup, once done make sure rewrite module is enabled:

a2enmod rewrite

then restart apache and the rewrite should work:

service apache2 restart

Hope you will figure it out with this, if you still have any questions don’t hesistate to ask them.