Jappe
January 20, 2023, 10:51pm
21
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
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.
Jappe
January 20, 2023, 11:42pm
22
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
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?
yes, everything outside of the home page is inaccessible and results in a 404 error
Jappe
January 21, 2023, 1:14pm
26
Donβt change it, leave it as https://domain.name/wordpress
, your wordpress installation is still in this folder.
for me following is working.
setup WP us usual.
complete first run setup.
login to WP admin page and go into setting.
adjust WP URL and remove wordpress
sub path.
create new 99-wordpress.conf
in the conf-available
folder.
$HTTP["host"] == "192.168.0.20" {
server.document-root = "/var/www/wordpress/"
}
enable configuration
lighty-enable-mod wordpress
restart web server
systemctl restart lighttpd.service
success