I was successfully able to change my .htaccess file to change the url to my website files, removing the access folder.
SITEMAP
index.php
/access
-dashboard.php
-posts.php
-account.php
Old URL : mywebsite.com/access/dashboard.php
New URL: mywebsite.com/dashboard.php
This is all working perfectly, the only issue is that, I can still access my files from the old url. I would like to redirect that url to the new one so that it is not used anymore. How can I do this?
Here is my current .htaccess file:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/access/$1.php -f
RewriteRule ^(.+?)/?$ access/$1.php [L,NC]