file getting 404 error due index.php in laravel 8 application deployed in IIS 10 windows server 2019

26 views Asked by At

I have a larvel 8 application working fine with index.php in the url, but the issue comes when trying to access a uploaded file. the uploaded file is stored in storage/app/public/reports/rail/filename.ext

notworking: http://www.example.com/project/index.php/storage/app/public/report/rail/1695294569-1736.pdf

workingurl: http://www.example.com/project//storage/app/public/report/rail/1695294569-1736.pdf

.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>
    php_value max_execution_time 0


    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    #Disable index view
options -Indexes

#hide a Specifuc File

<Files .env>
order allow,deny
Deny from all
</Files>
</IfModule>

Suggest me the solution for this

0

There are 0 answers