cancel
Showing results for 
Search instead for 
Did you mean: 

/pub root

/pub root

We got the result from magento official scan,

"Your Web server is configured to run Magento from %MAGENTO_ROOT% directory.
It is recommended to set %MAGENTO_ROOT%/pub as a Web server root directory."  

 

Is it necessary to set it?

 

 

2 REPLIES 2

Re: /pub root

Hello @alenwang9788 

 

Magento 2 have two root directory. we can use the pub folder as root to secure our server and files.

Magento recommends Magento_root/Pub to use as root for security purpose.

For more info you can follow below links:

https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html

https://alanstorm.com/magento-2-the-pub-folder/

 

Manish Mittal
https://www.manishmittal.com/

Re: /pub root

Hello. 

I have the same Issue. I followed the documentation in order to change document root to /pub. after I ran the online scanner ,but showing that my document root is not set to /pub. 

However, I have enabled SSL for both Front Page and Admin. 

Documentation is showing modification to Non Secure Virtual host of apache . 

Do I need to modify Secure Virtual Host ? if so , Do i have to alter Database like this?

UPDATE core_config_data SET value='http://domainname' WHERE path='web/secure/base_url';

online document states path='web/unsecure/base_url'

any info would be appreciate. 

Thanks.