Remove the .php from the web pages in the url

0

I have a .htaccess in the root of my web folder with the following content:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php

With this intent is that when accessing my website, I appear for example,

  

www.domainname.com/start

and not

  

www.nombredeldominio.com/inicio.php

Clarify that I have my website in a hosting that runs in Linux.

    
asked by Mario Guiber 30.05.2018 в 12:01
source

1 answer

1

The code that shows only one character is missing.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

Review the second RewriteCond and add inverted diagonal between {REQUEST_FILENAME} and .php -f

    
answered by 30.05.2018 / 15:23
source