I have the following .htaccess that does not work:
RewriteEngine on
RewriteBase /
RewriteRule ^find /findgames.php [L]
RewriteRule ^find/ /findgames.php [L]
If i remove the letter ‘d’ in ‘find’ everything works great:
RewriteEngine on
RewriteBase /
RewriteRule ^fin /findgames.php [L]
RewriteRule ^fin/ /findgames.php [L]
What am i missing? Is find a keyword? The second I have the letters ‘find’ in a row, i get a ‘Internal Server Error’ on my website.
That is absolutely correct and expected behaviour (the ‘Internal Server Error’ message) in your case. Although you should see the same error even without letter
d.The reason — bad matching pattern — it is way to broad. What
^findmeans? It means — match URL that starts withfind(leading slash is stripped by Apache). This will match/find,/find/,/findmeetc — as well as your target —/findgames.php.Most likely (in this particular case) you have infinite rewrite loop which Apache has to break at some point, hence the error. You can check Apache’s error log for exact error message — it will explain it quite well.
In any case — this should work for you — it will redirect requests for
/findas well as/find/(exact matches) to/findgames.php.