So I'm working on a site for a magazine, and I want the URL /latest
to rewrite to the file latest.php
. I'm working on a cPanel hosting server, so I put a .htaccess
in the /public_html
directory like so (important line is the 8th):
RewriteEngine On
RewriteRule ^archives/search/?$ /archives/search.php [L]
RewriteRule ^archives/([\d]{4})-([\d]{1})/?$ /archives/download.php?year=$1&issue=$2
RewriteRule ^archives/([\d]{4})/?$ /archives/download.php?year=$1
RewriteRule ^archives - [L]
RewriteRule ^admin - [L]
RewriteRule ^search - [L]
RewriteRule ^latest /latest.php [L]
RewriteRule ^contact/?$ /contact.php [L]
RewriteRule ^([a-z]+)/?$ /page.php?p=$1 [L]
ErrorDocument 404 /notfound.php
ErrorDocument 500 /dberror.php
However, upon navigating to /latest
, I get a 500 interal server error
. I originally thought it was some problem in the .php
file, but that was ruled out when I completely emptied the file latest.php and the error persisted. Interestingly, when I change the /latest
to anything else and navigate to that, it works. I have no idea why. I'd like to give the link to the full site, but it's still under development so I am not allowed to.