I migrated my kirby site to a new server by copying all files (including .htaccess) except the media folder. The media folder was then automatically recreated.
Now, all images are not shown and all internal links don’t work. Also I cannot access the panel using URL/panel.
By using inspector I found out that the images point to e.g. “media/pages/sps-kurse/c7b8239ecd-1766826900/XYZ.png” but in the media folder the structure is completely different, e.g.: “media/site/7bab96fd89-1766826898”
I use the template “Erlega Theme”, kirby version 4.3.0 and php version 8.2.
If an Apache server and .htaccess was successfully copied (as you say), make sure that mod_rewrite is enabled on the new server, and .htaccess overrides are allowed.
If not an Apache server, .htaccess is of no use, in that case, follow the link provided by @GB_DESIGN
Apache Webserver V2.4.66 with mod_rewrite enabled.
I found the solution: To test the migrated site on a temporary url, I disabled the rewrite rules in the .htaccess (otherwise it always redirected to the old url). But I also disabled the line RewriteEngine on - after enabling only this line everything worked fine.