Install the plugin “better search replace”. Search for http://123.123.123.123 and replace with http://example.com. You may want to update the local hosts file on your server and other devices on your lan to use the local IP address for the domain rather than routing things out and back.
Thanks for your prompt reply, I will try but I am not sure whether that solves the problem. E.g. if I enter http://123.123.123.123 the default WordPress page is loaded, sot it correctly redirects to /var/www/wordpress (all be it without properly loaded stylesheet). When I click on Logon at that page the link is:
http://123.123.123.123/wordpress/wp-login.php
Of course that’s wrong because it schould be: http://123.123.123.123/wp-login.php
So what I don’t get is first perfectly finds it DocumentRoot, i.e. /var/www/wordpress, but in links on the page /wordpress is prefixed again…
Point your domain (in your virtual host definition) to /var/www/wordpress rather than /var/www so things are easier.
It actually already is, but still links displayed have on the page have /wordpress in it added. That’s what confuses me:
This is my code:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/wordpress
ServerName mydomain.com
ServerAlias http://www.mydomain.com
<Directory /var/www/wordpress>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/mydomain.com_error.log
CustomLog ${APACHE_LOG_DIR}/mydomain.com_access.log combined
</VirtualHost>
what’s in your .htaccess file? What do you have for the site URL in settings->general?