404 not found magento 2 static and media files not loading
resources not loading after changing base url. i have tried changing base_url for media files.
magento2 404 base-url
add a comment |
resources not loading after changing base url. i have tried changing base_url for media files.
magento2 404 base-url
4
Possible duplicate of Magento 2 CSS and JavaScript not loading from correct folder
– Asish Hira
Apr 28 '16 at 8:05
my problem is that magento is looking directly in root floder for media and static files. it is not looking in pub/media folder
– usama
Apr 28 '16 at 8:15
1
Check the presence of .htaccess file inside pub/static. While Deleting the files under pub/static to get rid of any existing symlinks, we need to be be careful not to delete the .htaccess file.
– Suyash Kumar Bharti
Jan 9 '17 at 11:37
add a comment |
resources not loading after changing base url. i have tried changing base_url for media files.
magento2 404 base-url
resources not loading after changing base url. i have tried changing base_url for media files.
magento2 404 base-url
magento2 404 base-url
asked Apr 28 '16 at 7:48
usamausama
912
912
4
Possible duplicate of Magento 2 CSS and JavaScript not loading from correct folder
– Asish Hira
Apr 28 '16 at 8:05
my problem is that magento is looking directly in root floder for media and static files. it is not looking in pub/media folder
– usama
Apr 28 '16 at 8:15
1
Check the presence of .htaccess file inside pub/static. While Deleting the files under pub/static to get rid of any existing symlinks, we need to be be careful not to delete the .htaccess file.
– Suyash Kumar Bharti
Jan 9 '17 at 11:37
add a comment |
4
Possible duplicate of Magento 2 CSS and JavaScript not loading from correct folder
– Asish Hira
Apr 28 '16 at 8:05
my problem is that magento is looking directly in root floder for media and static files. it is not looking in pub/media folder
– usama
Apr 28 '16 at 8:15
1
Check the presence of .htaccess file inside pub/static. While Deleting the files under pub/static to get rid of any existing symlinks, we need to be be careful not to delete the .htaccess file.
– Suyash Kumar Bharti
Jan 9 '17 at 11:37
4
4
Possible duplicate of Magento 2 CSS and JavaScript not loading from correct folder
– Asish Hira
Apr 28 '16 at 8:05
Possible duplicate of Magento 2 CSS and JavaScript not loading from correct folder
– Asish Hira
Apr 28 '16 at 8:05
my problem is that magento is looking directly in root floder for media and static files. it is not looking in pub/media folder
– usama
Apr 28 '16 at 8:15
my problem is that magento is looking directly in root floder for media and static files. it is not looking in pub/media folder
– usama
Apr 28 '16 at 8:15
1
1
Check the presence of .htaccess file inside pub/static. While Deleting the files under pub/static to get rid of any existing symlinks, we need to be be careful not to delete the .htaccess file.
– Suyash Kumar Bharti
Jan 9 '17 at 11:37
Check the presence of .htaccess file inside pub/static. While Deleting the files under pub/static to get rid of any existing symlinks, we need to be be careful not to delete the .htaccess file.
– Suyash Kumar Bharti
Jan 9 '17 at 11:37
add a comment |
5 Answers
5
active
oldest
votes
In your magento root directory run the below command..
for windows system:
php bin/magento setup:static-content:deploy
For Linux/Ubuntu:
bin/magento setup:static-content:deploy
add a comment |
Magento 2.2.2
Apache/2.4.6 (CentOS)
I tried:
rm -rf pub/static/* generated/* var/page_cache/* var/cache/* var/view_preprocessed/*
chown -R apache:apache .*
find . -type d -exec chmod 0770 {} ;
find . -type f -exec chmod 0660 {} ;
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
Found out the pub/static/.htaccess file was missing. Added it back in and static content showed up.
1
big thanks Bernard, you saved my day :)
– Eugen Bogdanovich
Apr 9 '18 at 7:55
add a comment |
I had the same issue in magento 2, Ubuntu 16.04. You can resolve it by running the following command in your magento 2 root directory
sudo php bin/magento setup:static-content:deploy
In case it gives a warning and fails, run the above command forcibly, like,
sudo php bin/magento setup:static-content:deploy -f
Post this step, you will have to compile magento setup once again. So, run the following command.
sudo php bin/magento setup:di:compile
add a comment |
None of this worked for me. The problem was apache. Needed to set AllowOverride All
in the virtualhost due to Magento's many many .htaccess files.
add a comment |
Hello If your apache version is greater then 2.4 and you have share hosting then you need to follow this steps.
Open all .htaccess files
your_magento_setup/.htaccess,
pub/.htaccess
Then you just comment this tag fully in your both htaccess.
<IfVersion >= 2.4>
Your magento 2 setup working properly.. IF Not working then you can contact me on this Email kamalj27@gmail.com
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f113053%2f404-not-found-magento-2-static-and-media-files-not-loading%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
In your magento root directory run the below command..
for windows system:
php bin/magento setup:static-content:deploy
For Linux/Ubuntu:
bin/magento setup:static-content:deploy
add a comment |
In your magento root directory run the below command..
for windows system:
php bin/magento setup:static-content:deploy
For Linux/Ubuntu:
bin/magento setup:static-content:deploy
add a comment |
In your magento root directory run the below command..
for windows system:
php bin/magento setup:static-content:deploy
For Linux/Ubuntu:
bin/magento setup:static-content:deploy
In your magento root directory run the below command..
for windows system:
php bin/magento setup:static-content:deploy
For Linux/Ubuntu:
bin/magento setup:static-content:deploy
answered Apr 28 '16 at 7:52
Mohammad MujassamMohammad Mujassam
1,1171227
1,1171227
add a comment |
add a comment |
Magento 2.2.2
Apache/2.4.6 (CentOS)
I tried:
rm -rf pub/static/* generated/* var/page_cache/* var/cache/* var/view_preprocessed/*
chown -R apache:apache .*
find . -type d -exec chmod 0770 {} ;
find . -type f -exec chmod 0660 {} ;
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
Found out the pub/static/.htaccess file was missing. Added it back in and static content showed up.
1
big thanks Bernard, you saved my day :)
– Eugen Bogdanovich
Apr 9 '18 at 7:55
add a comment |
Magento 2.2.2
Apache/2.4.6 (CentOS)
I tried:
rm -rf pub/static/* generated/* var/page_cache/* var/cache/* var/view_preprocessed/*
chown -R apache:apache .*
find . -type d -exec chmod 0770 {} ;
find . -type f -exec chmod 0660 {} ;
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
Found out the pub/static/.htaccess file was missing. Added it back in and static content showed up.
1
big thanks Bernard, you saved my day :)
– Eugen Bogdanovich
Apr 9 '18 at 7:55
add a comment |
Magento 2.2.2
Apache/2.4.6 (CentOS)
I tried:
rm -rf pub/static/* generated/* var/page_cache/* var/cache/* var/view_preprocessed/*
chown -R apache:apache .*
find . -type d -exec chmod 0770 {} ;
find . -type f -exec chmod 0660 {} ;
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
Found out the pub/static/.htaccess file was missing. Added it back in and static content showed up.
Magento 2.2.2
Apache/2.4.6 (CentOS)
I tried:
rm -rf pub/static/* generated/* var/page_cache/* var/cache/* var/view_preprocessed/*
chown -R apache:apache .*
find . -type d -exec chmod 0770 {} ;
find . -type f -exec chmod 0660 {} ;
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
Found out the pub/static/.htaccess file was missing. Added it back in and static content showed up.
answered Dec 27 '17 at 14:31
BernardBernard
1306
1306
1
big thanks Bernard, you saved my day :)
– Eugen Bogdanovich
Apr 9 '18 at 7:55
add a comment |
1
big thanks Bernard, you saved my day :)
– Eugen Bogdanovich
Apr 9 '18 at 7:55
1
1
big thanks Bernard, you saved my day :)
– Eugen Bogdanovich
Apr 9 '18 at 7:55
big thanks Bernard, you saved my day :)
– Eugen Bogdanovich
Apr 9 '18 at 7:55
add a comment |
I had the same issue in magento 2, Ubuntu 16.04. You can resolve it by running the following command in your magento 2 root directory
sudo php bin/magento setup:static-content:deploy
In case it gives a warning and fails, run the above command forcibly, like,
sudo php bin/magento setup:static-content:deploy -f
Post this step, you will have to compile magento setup once again. So, run the following command.
sudo php bin/magento setup:di:compile
add a comment |
I had the same issue in magento 2, Ubuntu 16.04. You can resolve it by running the following command in your magento 2 root directory
sudo php bin/magento setup:static-content:deploy
In case it gives a warning and fails, run the above command forcibly, like,
sudo php bin/magento setup:static-content:deploy -f
Post this step, you will have to compile magento setup once again. So, run the following command.
sudo php bin/magento setup:di:compile
add a comment |
I had the same issue in magento 2, Ubuntu 16.04. You can resolve it by running the following command in your magento 2 root directory
sudo php bin/magento setup:static-content:deploy
In case it gives a warning and fails, run the above command forcibly, like,
sudo php bin/magento setup:static-content:deploy -f
Post this step, you will have to compile magento setup once again. So, run the following command.
sudo php bin/magento setup:di:compile
I had the same issue in magento 2, Ubuntu 16.04. You can resolve it by running the following command in your magento 2 root directory
sudo php bin/magento setup:static-content:deploy
In case it gives a warning and fails, run the above command forcibly, like,
sudo php bin/magento setup:static-content:deploy -f
Post this step, you will have to compile magento setup once again. So, run the following command.
sudo php bin/magento setup:di:compile
answered Oct 7 '16 at 6:27
AzherAzher
112
112
add a comment |
add a comment |
None of this worked for me. The problem was apache. Needed to set AllowOverride All
in the virtualhost due to Magento's many many .htaccess files.
add a comment |
None of this worked for me. The problem was apache. Needed to set AllowOverride All
in the virtualhost due to Magento's many many .htaccess files.
add a comment |
None of this worked for me. The problem was apache. Needed to set AllowOverride All
in the virtualhost due to Magento's many many .htaccess files.
None of this worked for me. The problem was apache. Needed to set AllowOverride All
in the virtualhost due to Magento's many many .htaccess files.
answered Nov 13 '18 at 22:14
David DomingoDavid Domingo
101
101
add a comment |
add a comment |
Hello If your apache version is greater then 2.4 and you have share hosting then you need to follow this steps.
Open all .htaccess files
your_magento_setup/.htaccess,
pub/.htaccess
Then you just comment this tag fully in your both htaccess.
<IfVersion >= 2.4>
Your magento 2 setup working properly.. IF Not working then you can contact me on this Email kamalj27@gmail.com
add a comment |
Hello If your apache version is greater then 2.4 and you have share hosting then you need to follow this steps.
Open all .htaccess files
your_magento_setup/.htaccess,
pub/.htaccess
Then you just comment this tag fully in your both htaccess.
<IfVersion >= 2.4>
Your magento 2 setup working properly.. IF Not working then you can contact me on this Email kamalj27@gmail.com
add a comment |
Hello If your apache version is greater then 2.4 and you have share hosting then you need to follow this steps.
Open all .htaccess files
your_magento_setup/.htaccess,
pub/.htaccess
Then you just comment this tag fully in your both htaccess.
<IfVersion >= 2.4>
Your magento 2 setup working properly.. IF Not working then you can contact me on this Email kamalj27@gmail.com
Hello If your apache version is greater then 2.4 and you have share hosting then you need to follow this steps.
Open all .htaccess files
your_magento_setup/.htaccess,
pub/.htaccess
Then you just comment this tag fully in your both htaccess.
<IfVersion >= 2.4>
Your magento 2 setup working properly.. IF Not working then you can contact me on this Email kamalj27@gmail.com
answered 25 mins ago
Kamal JainKamal Jain
414
414
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f113053%2f404-not-found-magento-2-static-and-media-files-not-loading%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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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
4
Possible duplicate of Magento 2 CSS and JavaScript not loading from correct folder
– Asish Hira
Apr 28 '16 at 8:05
my problem is that magento is looking directly in root floder for media and static files. it is not looking in pub/media folder
– usama
Apr 28 '16 at 8:15
1
Check the presence of .htaccess file inside pub/static. While Deleting the files under pub/static to get rid of any existing symlinks, we need to be be careful not to delete the .htaccess file.
– Suyash Kumar Bharti
Jan 9 '17 at 11:37