I operate a lighttpd webserver hosting Wordpress. For usability and marketing reasons I have registered a new domain that should replace the old one - site structure is unchanged. Wordpress setup is okay so far and works with the new domain.
Now I want to have all search engine results pointing to the old URL be redirected (301) by my Lighttpd server to the new url:
www.olddomain.xy/path/somepage.html should land on www.newdomain.xy/path/somepage.html
Here and elsewhere, I have found solutions that replace http with https, replace domain.xy with www.domain.xy or solutions that redirect any page from the old domain to the root directory of the new domain forgetting about the path. But this is not what I want.
I can't seem to wrap my head around the (regex-)syntax. Any ideas?
This somehow did the trick and also ensured to redirect to https:
rgds Chris