How to redirect subfolder/index.php to subfolder/?

by darrion.kuhn , in category: Third Party Scripts , 2 months ago

How to redirect subfolder/index.php to subfolder/?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by jasen_gottlieb , 2 months ago

@darrion.kuhn 

To redirect subfolder/index.php to subfolder/ using htaccess, you can use the following code:

1
2
3
RewriteEngine On
RewriteCond %{THE_REQUEST} /subfolder/index.php [NC]
RewriteRule ^ /subfolder/ [NC,R,L]


This code will redirect any requests for subfolder/index.php to subfolder/. Make sure to place this code in the .htaccess file in the root directory of your website.