Wordpress at Pi IP, webroot

I did a test on my testsystem, all I did was adding a new config to lighttpd:

server.modules += ("mod_redirect")
$SERVER["socket"] == ":80" {

url.redirect = ("^/$" => "/wordpress" ) }

I did not change the site url or anything, I left it on http://192.168.X.X/wordpress in the wp settings.
Works as expected :+1:
I tested also with another fresh browser.
It works not when I try to reach it via my domain, only with the local IP.
If you wanna make that work, you would need to change site-url / adress in the wp settings to your domain and change the lighttpd config a bit:

server.modules += ("mod_redirect")
$HTTP["host"] == "yourdomain.TLD" {

url.redirect = ("^/$" => "/wordpress" ) }

I will test this also real quick and report back.

I can also confirm this.
In wordpress settings I changed website and wordpress adress to:
https://MY.DOMAIN/wordpress and created a lighttpd config:

server.modules += ("mod_redirect")
$HTTP["host"] == "MY.DOMAIN" {url.redirect = ("^/$" => "/wordpress" ) }

Don’t forget to restart lighttpd :wink:

Thanks. I appreciate the assist on this as I learn lighttpd more.

I did a clean install of WP. I ran the setup per the dietpi first run config steps.

I created a file 99-wordpress.conf in the conf-enabled folder.

I then changed the Wordpress URL and Site URL in WP settings to https://domain.name.

I then rebooted the pi.

Browsing to https://domain.name resolves to https://domain.name/wordpress/ but then everything else breaks after that. Internal links are broken, can not get to wp-login.

you are trying to reach http://your.ip.com/wp-admin now?

1 Like

yes, everything outside of the home page is inaccessible and results in a 404 error

Don’t change it, leave it as https://domain.name/wordpress, your wordpress installation is still in this folder.

for me following is working.

  1. setup WP us usual.
  2. complete first run setup.
  3. login to WP admin page and go into setting.
  4. adjust WP URL and remove wordpress sub path.
  5. create new 99-wordpress.conf in the conf-available folder.
$HTTP["host"] == "192.168.0.20" {
    server.document-root = "/var/www/wordpress/" 
} 
  1. enable configuration
lighty-enable-mod wordpress
  1. restart web server
systemctl restart lighttpd.service
  1. success

what if we decide to use Apache or NGINX? this default “/wordpress/” folder breaks any attempt to import a backup from somewhere else… dietpi wordpress install should ask if we want it in www root

Honestly I don’t understand the question. You can choose the web server during installation and adjust configuration accordingly afterwards. Just take into account the different configuration files and folders depending on web server selected.

We don’t do this by purpose. Because we allow multiple web server applications next to each other. Therefore each web application has its own sub folders and configuration.