V
V
Vadim9972014-10-07 19:08:08
PHP
Vadim997, 2014-10-07 19:08:08

Why can't I hide the .php extension?

I decided to make it so that when entering pages like localhost/site/info, the info.php page opens. but 404 error appears. I use wamp, here is the code in .htaccess:

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

1 answer(s)
D
Dmitry Cherednichenko, 2014-10-07
@Vadim997

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question