Edits Server Error 500

59 Views Asked by At
RewriteEngine on
RewriteRule ^home index.php [NC,L]
RewriteRule ^news news.php [NC,L]

Would appreciate any help on how to address this. I have created a .htaccess file for my site in order to simplify its URLs. The entire .htaccess reads as follows (and works as desired):

RewriteEngine on

The only issue I'm facing now is that clicking on it generates a Server Error 500 page instead of the facebook share window.

What can I do to fix this issue

1

There are 1 best solutions below

14
On

You should use end anchor in your patterns and turn MultiViews off:

Options -MultiViews
RewriteEngine on

RewriteRule ^home/?$ index.php [NC,L]
RewriteRule ^news/?$ news.php [NC,L]
RewriteRule ^news/([0-9a-z]+)/?$ news.php?id=$1 [NC,L,QSA]

Without end anchor ^news pattern will also match news.php and cause infinite looping and eventually 500 (internal server error).