When the resource file local.comadminindex.css is used as the PATH_INFO request, the error 404 should be reported if the CSS file does not exist. But now 200 is returned...
My. htaccess file configuration
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php/$1
Access local.com/admin/index#correct
When accessing the resource file local.com/admin/index.css, the resource file is treated as a PATH_INFO request. if the CSS file does not exist, the error 404 should be reported. But now 200 is returned.
Please give me some advice on how to configure the. htaccess file.
Question added:
The following error occurs when you use the configuration provided by @ xialeistudio:
Accessframe.com/index.css
No error is reported in index.css. OK
Accessframe.com/pathtest/index.css
No index.css exists, but no error is reported.
Problem Description: an error can be reported when you access a resource file that does not exist in the root path, but no error is reported when you access a non-existent resource file that does not exist in the root path.
Reply content:
My. htaccess file configuration
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.*)$ index.php/$1
Access local.com/admin/index#correct
When accessing the resource file local.com/admin/index.css, the resource file is treated as a PATH_INFO request. if the CSS file does not exist, the error 404 should be reported. But now 200 is returned.
Please give me some advice on how to configure the. htaccess file.
Question added:
The following error occurs when you use the configuration provided by @ xialeistudio:
Accessframe.com/index.css
No error is reported in index.css. OK
Accessframe.com/pathtest/index.css
No index.css exists, but no error is reported.
Problem Description: an error can be reported when you access a resource file that does not exist in the root path, but no error is reported when you access a non-existent resource file that does not exist in the root path.
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_URI} !\.(css|js|png|jpeg|gif)$RewriteRule ^(.*)$ index.php/$1 [L]
For a configuration example, refer:
RewriteEngine on
RewriteBase/
RewriteRule (. *. css $ |. *. js $ |. *. jpg $ |. *. gif $ |. *. png $ |. *. ico $ |. *. swf $ |. *. txt $) $1 [L]
RewriteRule (. *) index. php [L]