1
I’m using the following code on a hostgator web server, but I can’t hide the extension .php
. How to solve this?
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
1
I’m using the following code on a hostgator web server, but I can’t hide the extension .php
. How to solve this?
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
2
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\\.php [L]
Of course this will not prevent the user from typing directly into the URL. /arquivo.php
Example of use.
You have a page http://foo.bar/home.php
, then you can access how http://foo.bar/home
It worked! I was actually thinking that the function simply hid the extension. I took the extensions of some links that direct to the pages and it worked, no longer displays the extension, only the site has more than 200 links to eliminate the extension of each one...
Browser other questions tagged php htaccess
You are not signed in. Login or sign up in order to post.
Are you doing this on localhost? using which wamp server?
– Bia
Did you check whether the
rewrite_module
this asset?– Jeferson Assis
So it seems that this code Rewriteengine on active, according to a tutorial that I read
– Henrique Mendes Silveira Rodri
I’m doing it on a hostgator web server
– Henrique Mendes Silveira Rodri
the answer to not having to change all pages or files is in the link
– Evandro Aguiar