I have a problem with xampp etc. When I typing in URL address, for example, http://localhost/project/index.php/whatever.php server opened index.php with crashed style instead Not Found The requested URL was not found on this server or something like that because /whatever.php does not exist in the project.
In console showed: Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost/project/index.php/style/style.css".
How I can prevent the open not existing path from my project ?
All versions of Apache allow this, it's normal... To solve your issue, please, edit your httpd.conf and where you have your VirtualHost config add this line:
AcceptPathInfo Off
Like here:
<VirtualHost localhost:80>
ServerName localhost:80
ServerAlias localhost
ErrorLog "${SRVROOT}/logs/localhost-error.log"
TransferLog "${SRVROOT}/logs/localhost-access.log"
DocumentRoot "D:/Web/www"
<Directory "D:/Web/www">
Require all granted
Options Indexes FollowSymLinks Includes ExecCGI
AcceptPathInfo Off
AllowOverride All
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
</Directory>
</VirtualHost>
If not enough add this line to your .htaccess
################################################################################
######################### Remove /index.php/ from URLs #########################
################################################################################
RedirectMatch 301 ^/index\.php(/.*) $1
Hope this helps.