I don't know how to make this, I tried doing this and this but somehow it doesn't work on me. I don't know where it went wrong. My file system has only one folder for now and it just loops and on the url, it just add and add the folder's name. here is my code: .htaccess
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
#php
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php
RewriteCond %{THE_REQUEST} ^GET\ /(([^/?]*/)*[^/?]+)\.php
RewriteRule ^.+\.php$ /%1 [L,R=301]
#html
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.html
RewriteCond %{THE_REQUEST} ^GET\ /(([^/?]*/)*[^/?]+)\.html
RewriteRule ^.+\.html$ /%1 [L,R=301]
RewriteRule ^ index.php [L]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^name(/.*|)$ $1 [L,NC]
</IfModule>
update: my goal is to make localhost/name/test.php turn in to localhost/test.php