Difference between root index.php and pub directory index.php in Magento2?

Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
3
down vote
favorite
Can any one tell me the logical difference between of using index.php in root directory and pub directory when we go live to point domain then which index.php should be pointed by domain?
magento2 domain
add a comment |Â
up vote
3
down vote
favorite
Can any one tell me the logical difference between of using index.php in root directory and pub directory when we go live to point domain then which index.php should be pointed by domain?
magento2 domain
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
Can any one tell me the logical difference between of using index.php in root directory and pub directory when we go live to point domain then which index.php should be pointed by domain?
magento2 domain
Can any one tell me the logical difference between of using index.php in root directory and pub directory when we go live to point domain then which index.php should be pointed by domain?
magento2 domain
magento2 domain
asked 2 hours ago
Charul Tyagi
41710
41710
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
Magento2 uses the /index.php is mainly for the CLI commands where there is no use of media and static folders. But while you access the website, you need to point to the index.php only. Because the media paths were defined only in pub/index.php.
add a comment |Â
up vote
2
down vote
Magento 2 generally use /index.php in root file. But when you will go live and change the mode to production Magento will use pub/index.php.
add a comment |Â
up vote
1
down vote
In magento 2 root/index.php and pub/index.php both index.php are entry points and they are reusing the same app/bootstrap.php
- The pub/index.php -- if you are able to configure the "pub" directory as the document root on Server.
- In order to run a Magento 2 web application, the "pub" directory is the only one that's necessary to expose.
- The rest you can hide (typically for security reasons, to avoid accidental exposing local.xml or something like that).
- It is more secure than root.
Hint : https://github.com/magento/magento2/issues/356
If our folder permissions are right then what security can be leaked due to using root index.php?
â Charul Tyagi
19 mins ago
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Magento2 uses the /index.php is mainly for the CLI commands where there is no use of media and static folders. But while you access the website, you need to point to the index.php only. Because the media paths were defined only in pub/index.php.
add a comment |Â
up vote
2
down vote
Magento2 uses the /index.php is mainly for the CLI commands where there is no use of media and static folders. But while you access the website, you need to point to the index.php only. Because the media paths were defined only in pub/index.php.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Magento2 uses the /index.php is mainly for the CLI commands where there is no use of media and static folders. But while you access the website, you need to point to the index.php only. Because the media paths were defined only in pub/index.php.
Magento2 uses the /index.php is mainly for the CLI commands where there is no use of media and static folders. But while you access the website, you need to point to the index.php only. Because the media paths were defined only in pub/index.php.
answered 1 hour ago
Pavan Kumar
3221211
3221211
add a comment |Â
add a comment |Â
up vote
2
down vote
Magento 2 generally use /index.php in root file. But when you will go live and change the mode to production Magento will use pub/index.php.
add a comment |Â
up vote
2
down vote
Magento 2 generally use /index.php in root file. But when you will go live and change the mode to production Magento will use pub/index.php.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Magento 2 generally use /index.php in root file. But when you will go live and change the mode to production Magento will use pub/index.php.
Magento 2 generally use /index.php in root file. But when you will go live and change the mode to production Magento will use pub/index.php.
answered 1 hour ago
Aniket Prajapati
287
287
add a comment |Â
add a comment |Â
up vote
1
down vote
In magento 2 root/index.php and pub/index.php both index.php are entry points and they are reusing the same app/bootstrap.php
- The pub/index.php -- if you are able to configure the "pub" directory as the document root on Server.
- In order to run a Magento 2 web application, the "pub" directory is the only one that's necessary to expose.
- The rest you can hide (typically for security reasons, to avoid accidental exposing local.xml or something like that).
- It is more secure than root.
Hint : https://github.com/magento/magento2/issues/356
If our folder permissions are right then what security can be leaked due to using root index.php?
â Charul Tyagi
19 mins ago
add a comment |Â
up vote
1
down vote
In magento 2 root/index.php and pub/index.php both index.php are entry points and they are reusing the same app/bootstrap.php
- The pub/index.php -- if you are able to configure the "pub" directory as the document root on Server.
- In order to run a Magento 2 web application, the "pub" directory is the only one that's necessary to expose.
- The rest you can hide (typically for security reasons, to avoid accidental exposing local.xml or something like that).
- It is more secure than root.
Hint : https://github.com/magento/magento2/issues/356
If our folder permissions are right then what security can be leaked due to using root index.php?
â Charul Tyagi
19 mins ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
In magento 2 root/index.php and pub/index.php both index.php are entry points and they are reusing the same app/bootstrap.php
- The pub/index.php -- if you are able to configure the "pub" directory as the document root on Server.
- In order to run a Magento 2 web application, the "pub" directory is the only one that's necessary to expose.
- The rest you can hide (typically for security reasons, to avoid accidental exposing local.xml or something like that).
- It is more secure than root.
Hint : https://github.com/magento/magento2/issues/356
In magento 2 root/index.php and pub/index.php both index.php are entry points and they are reusing the same app/bootstrap.php
- The pub/index.php -- if you are able to configure the "pub" directory as the document root on Server.
- In order to run a Magento 2 web application, the "pub" directory is the only one that's necessary to expose.
- The rest you can hide (typically for security reasons, to avoid accidental exposing local.xml or something like that).
- It is more secure than root.
Hint : https://github.com/magento/magento2/issues/356
answered 24 mins ago
Pradeep Thakur
393
393
If our folder permissions are right then what security can be leaked due to using root index.php?
â Charul Tyagi
19 mins ago
add a comment |Â
If our folder permissions are right then what security can be leaked due to using root index.php?
â Charul Tyagi
19 mins ago
If our folder permissions are right then what security can be leaked due to using root index.php?
â Charul Tyagi
19 mins ago
If our folder permissions are right then what security can be leaked due to using root index.php?
â Charul Tyagi
19 mins ago
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f243015%2fdifference-between-root-index-php-and-pub-directory-index-php-in-magento2%23new-answer', 'question_page');
);
Post as a guest
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
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
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
