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?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Using define() to set the constants should be all that’s required, unless the Apache configuration is using the IP as ServerName 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 check ServerName and ServerAlias 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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.