mardi 2 juillet 2019

I get a 500 Internal Server Error when trying to use a Rewrite rule in .htaccess file

I'm simply trying to change the url of my website from this.. www.website.com/game?id=3745&g=call-of-duty

to this.. www.website.com/game/3745/call-of-duty

but the rewriterule in my .htaccess file does nothing but create a "500 internal server error" when i attempt to use the latter url.

I've looked at every other solution on here and everyone says that the main problem is infinite looping, but i already have the necessary code to prevent infinite looping.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^game/([0-9]+)/([0-9a-zA-Z_-]+) game.php?id=$1&g=$2 [NC,L]

I also tried using [END] and also replacing the second condition with RewriteCond %{REQUEST_FILENAME} -f and that doesn't work. I'm using a shared host so please don't ask me to check my config or httpd file cause those are hidden, but i do know that mod_rewrite is working because i have another block of code above this one that succesfully hides the .php on my URLs.




Aucun commentaire:

Enregistrer un commentaire