I am creating / Publishing a directory, but I want this to be served by the main index.php, where there are files in this directory.
/ Publication? page = 1 will be served /index.php,/Publication/file.pdf - this is a file located in this directory.
Apache returend 403 error because the directory / publication is not allowed to be listed. You redirect the 403 error to /index.php, you cannot intercept catch variables. I think you can use the REDIRECT_QUERY_STRING variable, but this can ruin my php classes.
I changed the configuration of mod_rewrite to search directories, see "#", removed the ErrorDocument 403 directive, as it is not necessary.
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f # RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?path=$1 [L,QSA] </IfModule>
What i have
/Publication > /index.php?path=Publication /Publication/?page=1 > /index.php?path=Publication&page=1 /Publication/file.pdf > /Publication/file.pdf
source share