Cannot upload - 500 error, probably .htaccess fault

Phoca Gallery - image gallery extension
User avatar
KarEm
Phoca Professional
Phoca Professional
Posts: 154
Joined: 20 Dec 2015, 21:25

Re: Cannot upload - 500 error, probably .htaccess fault

Post by KarEm »

Hi,
100th post
ähmm, thx

Let's have a closer look to the redirected you want to achieve.
Always
I added a www to non-www redirect
?

Your rewrite rule includes the https protocol for an encrypted connection:

Code: Select all

RewriteRule (.*) https://domain.com/$1 [R=301,L]
Could you please list the desired redicrect (e.g. with and without www, https?).

Regards
KarEm
michalkr53
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 14 Oct 2019, 14:10

Re: Cannot upload - 500 error, probably .htaccess fault

Post by michalkr53 »

Hey,
the goal I wanted to reach with the redirect is to redirect from any address that begins with www (www.domain.com/something) to an address without www (domain.com/something) and it works. The https fragment in the RewriteRule is not necessary, the server forces everything to go through https anyway.

As I said, I'm not familiar with .htaccess syntax etc., I didn't write these two lines of code, I copied them from this site: https://www.balbooa.com/knowledgebase/3 ... to-non-www (btw this is not an ad, I have nothing to do with this website).

Is it possible to alter it to make it work, or maybe add an exclusion to /administrator/ or something like that?
Also thanks for all the insight You already gave me.
User avatar
KarEm
Phoca Professional
Phoca Professional
Posts: 154
Joined: 20 Dec 2015, 21:25

Re: Cannot upload - 500 error, probably .htaccess fault

Post by KarEm »

Hi,
whatever the reasons, in the original code of albooa the rewriteRule has been changed from http to https.
Please change this back accordingly and test if the upload works without an error message.

If the upload fails again, please test with the following variant:

Code: Select all

RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
With these entries in the .htaccess file all calls for a domain with www are redirected to the variant without www.

Regards
KarEm
michalkr53
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 14 Oct 2019, 14:10

Re: Cannot upload - 500 error, probably .htaccess fault

Post by michalkr53 »

Hey,
just came back home, sorry for answering late. The problem persists when using both of these solutions.

I can see through the Firefox's network monitor that the solutions are applied, because Phoca Gallery doesn't redirect like before (https://www.domain.com -> https://domain.com),
it now redirects from
https://www.domain.com to http://domain.com and then to https://domain.com.
Both of the solutions have the same effect.

I start to think the only solution is to let Phoca Gallery stay on www - when I turned off the .htaccess it went through www without redirecting and uploaded the file. How can I achieve that with .htaccess on?
Thanks for answering.
User avatar
KarEm
Phoca Professional
Phoca Professional
Posts: 154
Joined: 20 Dec 2015, 21:25

Re: Cannot upload - 500 error, probably .htaccess fault

Post by KarEm »

Hi,
I'm sorry, at this point I can't continue to support. Maybe someone else with deeper knowledge of the system can take over.

Regards
KarEm
michalkr53
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 14 Oct 2019, 14:10

Re: Cannot upload - 500 error, probably .htaccess fault

Post by michalkr53 »

Alright, that's understandable. You've helped me a lot, now that the issue is nailed down to a single file.
Thank You very much!
User avatar
KarEm
Phoca Professional
Phoca Professional
Posts: 154
Joined: 20 Dec 2015, 21:25

Re: Cannot upload - 500 error, probably .htaccess fault

Post by KarEm »

Hi,
please do not get me wrong. The change that I have described in my first post is implemented on one of the sites that I mantain and works without any problems, even uploading of images works completely flawlessly.
Therefore I am not really 100% convinced that your problem is only caused by the .htaccess.
No details are known from your system, there may be differences and therefore it may be that there are any side effects that prevent the upload.
My idea is that somebody else already had this problem or has more extensive knowledge to help faster with problem solving.

Regards
KarEm
michalkr53
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 14 Oct 2019, 14:10

Re: Cannot upload - 500 error, probably .htaccess fault

Post by michalkr53 »

Alright, I'll mess around some more, thanks!
christine
Phoca Hero
Phoca Hero
Posts: 2735
Joined: 28 Nov 2010, 17:20

Re: Cannot upload - 500 error, probably .htaccess fault

Post by christine »

Thanks for responding, also congrats on the 100th post!
also thanks to you KarEm for your excellent support! 8)

Kind regards
Christine
Post Reply