Home > Article > Backend Development > Apache pseudo-static setting redirects all access directories or files to index.php, but it is invalid when accessing the directory? ? ?
The rewriting rules are as follows:
<code> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,PT,L]</code>
For example:
If the accessed directory does not exist or when accessing a file, it can be redirected normally
If you access an existing directory
I don’t know how to redirect the access directory to the index.php file? ?
The rewriting rules are as follows:
<code> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,PT,L]</code>
For example:
If the accessed directory does not exist or when accessing a file, it can be redirected normally
If you access an existing directory
I don’t know how to redirect the access directory to the index.php file? ?
Turn off display directory in configuration