Can't remove .php extension with .htaccess

http://unvc.epizy.com

I added:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]

but I can’t go directly to http://unvc.epizy.com/music
cause of 404 error

Welcome.

When did you create your account?

Also, try this.

registred 2022-06-07, and I cleared cache every time after uploading css

Try this code instead:

RewriteEngine on

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R,L,NC]

I am getting a 302 error code, so I think the .htaccess code may be the cause (Or the PHP file is causing it). Source.

not working

What happens if you remove the .htaccess file and clear your cache?

everything remains the same

Then the error is with the file, not the htaccess code. Are you sure that file exists?

Please screenshot its location using the file manager, and paste it’s contents here.

Thanks

4 Likes

f**k, I renamed .htaccess to .htacces
THANK YOU A LOT

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.