I have a problem with my local WAMP server on Windows, it automatically adds the extension ".php" to the url if the file exists. For example, in the following structure:
+ www
+ files
- main.php
if I call the url http://localhost/files/main
it automatically shows me the file main.php
.
I was trying to identify where the redirection is but I have not found it. I clarify that I do not have any ".htaccess" file, I have even tried disabling the extension mod_rewrite
, I have also searched for a VirtualHost
that is redirecting and I have not found anything either.
Removing the Type application / x-httpd-php .php
no longer redirects, but of course, it no longer interprets the PHP files.
I need to solve this since it is giving me problems when wanting to rewrite a url with "htaccess" since it adds the extension ".php" to the file.
For example, with the following .htaccess
file:
RewriteEngine On
RewriteRule (.*) files/main.php?url=$1 [QSA,L]
And the following main.php
file:
<?php print_r($_GET); ?>
When calling the url http://localhost/files/main/param
the file main.php
runs and shows me the url: files/main.php/param
(note that the extension has been added ".php" to the main file).
Does anyone know what may be due and how to fix it?