I hope this was not asked over and over again before, but I didn\'t get further to an answer using google, w3schools and so on. So here is my question: I\'m writing a script
You need to add a RewriteBase /projects to the htaccess. That way the redirect will work properly.
RewriteBase /projects
Edit:
RewriteEngine on RewriteRule ^index.php - [L] RewriteRule ^([^/]+)/?$ index.php?dir=$1 [R,L]