cancel
Showing results for 
Search instead for 
Did you mean: 

Server configuration to restrict serving files

Server configuration to restrict serving files

Hello,

 

I am configuring a new Fedora server to host a magento site as a noob and currently files from the root directory are getting sent to the browser.  Everything else in the store is working fine however hitting site.com/mage and site.com/composer.json get the contens of those files rendered to the browser.  I have double checked the .htaccess file is using the default file and apache is configured to allow all overrides.  Another test shows the .htaccess rules working like RELEASE_NOTES.txt being restricted etc. I'm hoping this is a simple misconfiguration due to my noobness.

 

Mez

2 REPLIES

Re: Server configuration to restrict serving files

Unless I'm mistaken "composer.json" is not part of the Magento installation and as such not restricted by the Magento .htaccess file.

You will need to add additional rules yourself to .htaccess to restrict this files access from the browser.

Re: Server configuration to restrict serving files

If you don't want user see composer.json file on browser, you can deny it via .htaccess with this code

 

<Files ./composer.json>

Order Allow,Deny

Deny from all

</Files>

 

You can do the same for all other files

- Magento Tutorial many tips for magento
- Best Magento Hosting 2015 make magento FAST easy