How to set the webroot in Magento 2?Why Magento 2 have 2 possible root folder?Magento 2 Upgrade 404 Error (document root set to PUB folder)Where are the javascript files from Magento 2.1.1?How to Run Magento 2 using pub/index.php fileMagento 2 - How to detect if a script is in the pub directoryWhere is the data related to PHP version stored in Magento?Magento 2 + Nginx: Multiple websites homepages work but every other URL is 404Physical location of robots.txt file in Magento 2.2Magento2 - Run Magento multistore from pub directoryDifference between root index.php and pub directory index.php in Magento2?
Don't understand notation of morphisms in Monoid definition
Is being an extrovert a necessary condition to be a manager?
How to draw with Tikz a chord parallel to AC that passes through a point?
Why are logically related bit fields in MCU registers often in separate locations
Good examples of "two is easy, three is hard" in computational sciences
Why is there no current between two capacitors connected in series?
Circuit construction for execution of conditional statements using least significant bit
Parse a C++14 integer literal
Is there a way to generate a mapping graph like this?
pwaS eht tirsf dna tasl setterl fo hace dorw
Department head said that group project may be rejected. How to mitigate?
Removing Doubles Destroy Topology
How can I use 400 ASA film in a Leica IIIf, which does not have options higher than 100?
Which one of these Isp's for the Dawn spacecraft is wrong?
Mikrokosmos, BB 105, Vol. 1: No. 17 Contrary Motion (1) - Can't understand the structure
Is there a word for pant sleeves?
Existence of a model of ZFC in which the natural numbers are really the natural numbers
Filter a file list against an integer array?
Do most Taxis give Receipts in London?
Will this series of events work to drown the Tarrasque?
If you attack a Tarrasque while swallowed, what AC do you need to beat to hit it?
Separate the element after every 2nd ',' and push into next row in bash
Warped chessboard
How can sister protect herself from impulse purchases with a credit card?
How to set the webroot in Magento 2?
Why Magento 2 have 2 possible root folder?Magento 2 Upgrade 404 Error (document root set to PUB folder)Where are the javascript files from Magento 2.1.1?How to Run Magento 2 using pub/index.php fileMagento 2 - How to detect if a script is in the pub directoryWhere is the data related to PHP version stored in Magento?Magento 2 + Nginx: Multiple websites homepages work but every other URL is 404Physical location of robots.txt file in Magento 2.2Magento2 - Run Magento multistore from pub directoryDifference between root index.php and pub directory index.php in Magento2?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm learning Magento 2 and can see that Magento has two index.php
files. One is in the root folder and another one is in Pub folder. While reading many of the posts regarding webroot of Magento, I can see that we have to set the webroot to Pub folder for security.
Currently, I have installed the Magento in Xampp.
Can anyone please tell me how to set the webroot to Pub in Magento 2?
magento2 webroot
add a comment |
I'm learning Magento 2 and can see that Magento has two index.php
files. One is in the root folder and another one is in Pub folder. While reading many of the posts regarding webroot of Magento, I can see that we have to set the webroot to Pub folder for security.
Currently, I have installed the Magento in Xampp.
Can anyone please tell me how to set the webroot to Pub in Magento 2?
magento2 webroot
add a comment |
I'm learning Magento 2 and can see that Magento has two index.php
files. One is in the root folder and another one is in Pub folder. While reading many of the posts regarding webroot of Magento, I can see that we have to set the webroot to Pub folder for security.
Currently, I have installed the Magento in Xampp.
Can anyone please tell me how to set the webroot to Pub in Magento 2?
magento2 webroot
I'm learning Magento 2 and can see that Magento has two index.php
files. One is in the root folder and another one is in Pub folder. While reading many of the posts regarding webroot of Magento, I can see that we have to set the webroot to Pub folder for security.
Currently, I have installed the Magento in Xampp.
Can anyone please tell me how to set the webroot to Pub in Magento 2?
magento2 webroot
magento2 webroot
asked May 14 at 12:21
SivaSiva
460213
460213
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can achieve this by updating your virtual host file, you need to change DocumentRoot DocumentRoot /var/www/html/magento2ce/pub
:
Example code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2ce/pub
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory "/var/www/html">
AllowOverride all
</Directory>
</VirtualHost>
For more information refer magento 2 devdocs
https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html
add a comment |
To set webroot to pub you will have to tell Magento where the pub folder actually is with something like this
#File: pub/index.php
$params = $_SERVER;
$params[Mage::PARAM_APP_URIS][Mage_Core_Model_Dir::PUB] = '';
$entryPoint = new Mage_Core_Model_EntryPoint_Http(new Mage_Core_Model_Config_Primary(BP, $params));
You can also refer to https://alanstorm.com/magento-2-the-pub-folder/. But be ready to face some problems. You can find some of the problems you will face here https://github.com/magento/magento2/issues/15092
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f274547%2fhow-to-set-the-webroot-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can achieve this by updating your virtual host file, you need to change DocumentRoot DocumentRoot /var/www/html/magento2ce/pub
:
Example code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2ce/pub
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory "/var/www/html">
AllowOverride all
</Directory>
</VirtualHost>
For more information refer magento 2 devdocs
https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html
add a comment |
You can achieve this by updating your virtual host file, you need to change DocumentRoot DocumentRoot /var/www/html/magento2ce/pub
:
Example code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2ce/pub
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory "/var/www/html">
AllowOverride all
</Directory>
</VirtualHost>
For more information refer magento 2 devdocs
https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html
add a comment |
You can achieve this by updating your virtual host file, you need to change DocumentRoot DocumentRoot /var/www/html/magento2ce/pub
:
Example code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2ce/pub
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory "/var/www/html">
AllowOverride all
</Directory>
</VirtualHost>
For more information refer magento 2 devdocs
https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html
You can achieve this by updating your virtual host file, you need to change DocumentRoot DocumentRoot /var/www/html/magento2ce/pub
:
Example code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/magento2ce/pub
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory "/var/www/html">
AllowOverride all
</Directory>
</VirtualHost>
For more information refer magento 2 devdocs
https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html
answered May 14 at 12:24
Saphal JhaSaphal Jha
1,052616
1,052616
add a comment |
add a comment |
To set webroot to pub you will have to tell Magento where the pub folder actually is with something like this
#File: pub/index.php
$params = $_SERVER;
$params[Mage::PARAM_APP_URIS][Mage_Core_Model_Dir::PUB] = '';
$entryPoint = new Mage_Core_Model_EntryPoint_Http(new Mage_Core_Model_Config_Primary(BP, $params));
You can also refer to https://alanstorm.com/magento-2-the-pub-folder/. But be ready to face some problems. You can find some of the problems you will face here https://github.com/magento/magento2/issues/15092
add a comment |
To set webroot to pub you will have to tell Magento where the pub folder actually is with something like this
#File: pub/index.php
$params = $_SERVER;
$params[Mage::PARAM_APP_URIS][Mage_Core_Model_Dir::PUB] = '';
$entryPoint = new Mage_Core_Model_EntryPoint_Http(new Mage_Core_Model_Config_Primary(BP, $params));
You can also refer to https://alanstorm.com/magento-2-the-pub-folder/. But be ready to face some problems. You can find some of the problems you will face here https://github.com/magento/magento2/issues/15092
add a comment |
To set webroot to pub you will have to tell Magento where the pub folder actually is with something like this
#File: pub/index.php
$params = $_SERVER;
$params[Mage::PARAM_APP_URIS][Mage_Core_Model_Dir::PUB] = '';
$entryPoint = new Mage_Core_Model_EntryPoint_Http(new Mage_Core_Model_Config_Primary(BP, $params));
You can also refer to https://alanstorm.com/magento-2-the-pub-folder/. But be ready to face some problems. You can find some of the problems you will face here https://github.com/magento/magento2/issues/15092
To set webroot to pub you will have to tell Magento where the pub folder actually is with something like this
#File: pub/index.php
$params = $_SERVER;
$params[Mage::PARAM_APP_URIS][Mage_Core_Model_Dir::PUB] = '';
$entryPoint = new Mage_Core_Model_EntryPoint_Http(new Mage_Core_Model_Config_Primary(BP, $params));
You can also refer to https://alanstorm.com/magento-2-the-pub-folder/. But be ready to face some problems. You can find some of the problems you will face here https://github.com/magento/magento2/issues/15092
answered May 14 at 12:25
surbhi agrsurbhi agr
48312
48312
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f274547%2fhow-to-set-the-webroot-in-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown