Cannot upload - 500 error, probably .htaccess fault
Posted: 14 Oct 2019, 14:44
Yesterday I wanted to upload some images, but it didn't work.
When uploading them one by one, I receive a 500 error (Layout "form" not found), and when doing a multiple upload it stops on the first image and doesn't upload it.
I'm using the HTML5 uploader, and everything in the size limit settings and permissions is alright. The files are .jpg, tried different images, filenames are also okay, they are just alphanumeric characters without any spaces or any other special characters. I played around the settings, tried different uploaders etc.
The problem didn't occur a couple of weeks ago, and during that period of time the only thing I changed was my .htaccess file. I added a www to non-www redirect. The redirect is working, didn't mess up anything apart from the image uploading.
I'm 90% sure that is the reason of the problem, because when I looked up the server logs, all of the requests were coming from the non-www domain, apart from the Phoca Gallery component, which was accessed from the www version and then immediately redirected to non-www.
The gallery functions as usual (thumbnails, adding already uploaded images, displaying images, adding categories etc.), only the upload process doesn't work.
Is there any way to upload the images, other than FTP and reverting the 301 redirect back to www? Also it's worth noting that I know little to nothing about .htaccess files and how to write the rules.
Screenshot: https://i.imgur.com/nD6DbxM.png
When uploading them one by one, I receive a 500 error (Layout "form" not found), and when doing a multiple upload it stops on the first image and doesn't upload it.
I'm using the HTML5 uploader, and everything in the size limit settings and permissions is alright. The files are .jpg, tried different images, filenames are also okay, they are just alphanumeric characters without any spaces or any other special characters. I played around the settings, tried different uploaders etc.
The problem didn't occur a couple of weeks ago, and during that period of time the only thing I changed was my .htaccess file. I added a www to non-www redirect. The redirect is working, didn't mess up anything apart from the image uploading.
Code: Select all
RewriteCond %{HTTP_HOST} www.domain.com
RewriteRule (.*) https://domain.com/$1 [R=301,L]
The gallery functions as usual (thumbnails, adding already uploaded images, displaying images, adding categories etc.), only the upload process doesn't work.
Is there any way to upload the images, other than FTP and reverting the 301 redirect back to www? Also it's worth noting that I know little to nothing about .htaccess files and how to write the rules.
Screenshot: https://i.imgur.com/nD6DbxM.png