Answer the question
In order to leave comments, you need to log in
How to hide file extension in browser bar?
Hello, I googled on this issue, everywhere they force this code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
Answer the question
In order to leave comments, you need to log in
As far as I remember, although apache is present in openserver, it is, as it were, not used by default. Instead, nginx is launched. You need to either switch to Apache, or do the same, but with nginx configs and not Apache ones. .htaccess is purely Apache stray. There is no such thing in Orthodox nginx.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
This code is not "forced" anywhere because it is meaningless.
Like the "hide file extension" task itself.
If your task is to make "beautiful" (they are also "human-understandable") addresses, then you should write it this way and look for the code for this task.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question