My website is this : https://www.marketplace.jawadditaksal.org
when I checked pub folder as a url in the browser: https://www.marketplace.jawadditaksal.org/pub/
it appear like css is not working, what should I do, what is the use of PUB folder, how to show error 404 when user check this as a proper url on the browser?
Thank you
Hello @parminder _singh
As I can see you are trying to access the pub folder o is there any specific reason you want to access pub folder. Pub folder role is to save all static content in pub. so if you will try to call stored files in pub folder you load all files.
Or if you want to access pub folder then try to reset pub folder index.php as entry point.
For you reference: https://alanstorm.com/magento-2-the-pub-folder/
@Manish Mittal basically I want to that when someone will search my website url in this https://www.marketplace.jawadditaksal.org/pub/ error 404 should come but now you are saying that simply I should add a index.php file in the folder? right?
could you please run the below command in magento root folder:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
and also please check .htaccess file.
And also check the pub folder permission
Thanks
@selva_mage_dev I run these commands in the putty but nothing happened
please check the file permission its 777: https://ibb.co/n7t0bxv and what I need to check in the .htacess file.
@parminder _singh wrote:what I need to check in the .htacess file.
Could you please contact you Support Team(Hosting Provider).
Please provide the site url.
Thanks
Selva
Could you please set the 777 permission inside of all folder in pub folder. And also please contact to Hosting provider.And also please disable the cache and clear the cache.
Thanks
Selva
make sure apache “rewrite_module” is enable and the restart the server.
Problem solved? Click Kudos & Accept as Solution!
Thanks
Selva
@selva_mage_dev now I got it, see when I installed magento in the server by default magento adds two .htaccess files: one in the domain directory and one in /pub, which I have renamed to ".htaccess_no" because at that time website was not working so in the pub folder I renamed the htacess file and website was working and which is now working also.
Setting that back to ".htaccess" in the pub folder again will block that page from loading the secondary
so main index.php has connection with the pub folder, if I rename the htaccess file of pub folder from "htacess_no" to "htacess" website again stop working.
but still pub folder solution is not solved. So for now What I did is I add the empty index.php file in the pub folder and changed the name old index.php file to indexx.php
now see https://www.marketplace.jawadditaksal.org/pub/
but to change the pub folder index.php from old to new, is it fine for the website?