I did it. It doesn´t work. I had another take, getting help from IA, but it doesnt work too. This is my last config, it didn´t work either. I think Infinity Free has some limitation:
# Activar mod_rewrite
RewriteEngine On
# Forzar HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Ocultar extensión .php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/.]+)$ $1.php [L]
# Redirigir todo a router.php si no es un archivo o directorio existente
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ router.php [L]
# Redirigir /index.php a /
RewriteRule ^index\.php$ / [R=301,L]
Its not a limitation of infinity free. As people have done this before and it’s worked.
you’re not trying to remove the ?i=1 in you? because if your .htaccess does that it’ll be blocked (I cant see anything that would do this, but thought I’d check)
I used this thread, and the example works for my site:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^.]+)$ $1.php [NC,L]
please note this doens’t make the php extention automatically vanish. It just means that when writing out the link, you don’t need to include the “.php”
For me, that meant a full rewrite of my site to update the links haha. But it was worth it
Remember that caching can cause problems too. you may need to clear your cache, or use an incognito session on your browser to see the change.
If this doesn’t do what you want it to, can you please elaborate on what you mean by “hide the .php extension”? Please explain what should happen on your website if a visitor accesses a certain URL.