Mobile app version of vmapp.org
Login or Join
Candy875

: The presence of a .htaccess configuration causes a 500 error (even if it is blank) My htaccess file is giving my webpage a 500 error and I do not understand why ... this is the code:

@Candy875

Posted in: #Error #Htaccess #HttpCode500

My htaccess file is giving my webpage a 500 error and I do not understand why ...
this is the code:

AddHandler application/x-httpd-php56 .php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /gallery-page.php?galerie=



If I take the .htaccess file away, then I get 404 errors on the pages I needed renaming.
If I have the .htaccess file with no code in it, I still get an error 500.


If somebody can help me understand, it would be great !

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

2 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah324

I haven't scoped for AddHandler application/x-httpd-php56 .php but I stake the following on all of my websites:

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) %{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


Also, be sure to remove the HTTPS conditions if your site isn't SSL.

10% popularity Vote Up Vote Down


 

@Berumen354

Your .htaccess syntax looks okay and running it through a validator confirms the syntax is fine. You can check your error log to see more information and see what is causing it but depending on your hosting environment (especially if it is a shared hosting server) you will probably find that the issue is the AddHandler application/x-httpd-php56 .php line. Many hosting providers prevent adding additional file handlers through .htaccess as it can cause security issues on the server. If your hosting provider does not already have PHP support on the server then simply adding that line to your .htaccess won't make it work and would produce a 500 error as there is no PHP installed on the server to process it, and if there is then the server will already be configured to handle PHP files and so there still would be no need to have that line added. Try removing that line and you should see it working.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme