I can login to wp dashboard using my ip address, but not my domain name, i.e:
12.345.67.89/wp-admin works ok mydomain.com/wp-admin doesn’t work
I just get taken back to the login page again when I enter correct login details. (If I enter incorrect ones I get the usual error message).
I’m assuming it is some settings somewhere, but I don’t know where.
I’ve edit my wp-config file:
define(‘WP_HOME’,‘http://mydomain.com’); define(‘WP_SITEURL’,‘http://mydomain.com’);
Is there something else I’m missing?
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.
Thanks for the tips.
I did all that and I’ve managed to get it working. I think in the end it was something to with the write permissions for .htaccess.
@robertjamespeacock
Using
define()
to set the constants should be all that’s required, unless the Apache configuration is using the IP asServerName
instead of your actual domain.You can check the file in
/etc/apache2/sites-available
that corresponds to your website to see how the VirtualHost is setup. You’ll want to checkServerName
andServerAlias
to see what is listed as the domain/IP.Also make sure your domain is setup with the correct
A
entry pointing to your server IP.Beyond that, clear your cookies/cache before trying to login again, just to make sure that isn’t the issue.
Thanks to @robertjamespeacock, this is working on my wordpress webiste. But I still in confusion of is this work for security. How effective is this? I did blocking ip address using .htaccess file.