I just want to hide the dir name from the URL.
From : example.com/dirname/somepage to: example.com/somepage
This code does not work for me, I probably made some mistakes
RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule / /dir/$1 [L]
I already have this .htaccess (to hide the php extension)
RewriteEngine On RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L]
source share