Which folder to add a public accessible file in yii-framework?

1k Views Asked by At

I need to upload a public accessible file in yii installation which I can access from url. This is domain verification file. I've uploaded it in /frontend/web folder but it's not accessible directly via url mydomain.com/file.txt

As pointed out below, .htaccess file may be preventing this file to be accessible. Can anyone let me know how to write rule in .htaccess file to allow it?

2

There are 2 best solutions below

0
e-israel On

If you get the following error.

You don't have permission to access /frontend/web/ on this server.

Then, add the following rule in your .htaccess

<Directory "/path/to/frontend/web/">
   Options +Indexes
   Allow from all
</Directory>

Here the documentation about Apache .htaccess permissions

0
Hiren Makwana On

This might help

<Files *.*>
Order Deny,Allow
Deny from all
</Files>
 
<Files ~ "^index\.php|css|js|.*\.png|.*\.jpg|.*\.gif|.*\.jpeg|.*\.ttf">
  Allow from all
</Files>