Already some time ago, I migrated my (hosted) website from a Windows to a Linux/Apache/PHP environment. The move also caused a reorganization of the structure of the website, so I created a simple .htaccess file to do some redirects: RedirectMatch permanent (.*)\.htm$ $1.php Redirect permanent /english/dir1 http://www.mysite.com Redirect permanent /english/dir2 http://www.mysite.com Redirect permanent /english/dir3 http://www.mysite.com ErrorDocument 404 http://www.mysite.com/404.php This has always worked fine. However, in the statistics, I still saw a lot of requests for the page default.php. In the previous Windows environment, default.htm was the homepage. Apparently, several sites or bookmarks still contained this reference to the old homepage, which were now being redirected to default.php. However, on the Linux system, this page does not exist since index.php is the homepage. So, I decided to add another redirect to the .htaccess file to handle this: RedirectMatch permanent (.*)\.htm$ $1.php Redirect permanent /english/dir1 http://www.mysite.com Redirect permanent /english/dir2 http://www.mysite.com Redirect permanent /english/dir3 http://www.mysite.com Redirect permanent default.php index.php ErrorDocument 404 http://www.mysite.com/404.php However, after upload, this results in an error 500 while accessing the site. I am not an expert in these things, but the code looks correct, so what is causing this? A better way of writing this?
Thank you very much! That does the trick! Apparently, my understanding of the 'correct' syntax wasn't as correct as I thought...