I think there is some problem in my htaccess code but I cannot able to figure out.
What I need is.
1) Remove .php extension from the address like www.domain.com/index instead of www.domain.com/index.php
2) Remove the folder name. My website files store in a folder called public. I want to remove it. www.domain.com/public/index.php to www.domain.com/index
I wrote the below code, please let me know whats wrong in this.
# This will hide the folder name public and the php text
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+public/([^\s]+) [NC]
RewriteRule ^ %1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
# if you face any problem than try to uncomment the below line and delete the line after it
RewriteRule (?!^public/)^(.*)$ public/$1 [L,NC]