Magento 2 404 on all pages/files (except homepage)Magento 2 Wamp installation CSS/JS files return 404 error - multi storeStatic files aren't deploying in developer modeCss/js/font files not loading in the Admin area - except twoRefused to apply style “because its MIME type ('text/html') is not a supported stylesheet MIME type”Style sheet is not working when new theme is created in magento 2.2.5?Magento 2 : Refuse to apply style.less file not complied in .css file in magneto2Css not loading after theme installationInstalled magento 2.1 on windows but it is is giving many require js errorsI am getting jquery error while adding custom field in payment method in magento 2?

Does convergence of polynomials imply that of its coefficients?

What is the reasoning behind standardization (dividing by standard deviation)?

Did Nintendo change its mind about 68000 SNES?

Pre-Employment Background Check With Consent For Future Checks

What is the tangent at a sharp point on a curve?

Why does Surtur say that Thor is Asgard's doom?

"Marked down as someone wanting to sell shares." What does that mean?

Can "few" be used as a subject? If so, what is the rule?

What are the rules for concealing thieves' tools (or items in general)?

Isn't the word "experience" wrongly used in this context?

Determine voltage drop over 10G resistors with cheap multimeter

Error in master's thesis, I do not know what to do

How can an organ that provides biological immortality be unable to regenerate?

Is VPN a layer 3 concept?

Is this Pascal's Matrix?

Why doesn't the fusion process of the sun speed up?

Unable to get newly inserted Product's Id using After Plugin for Catalog Product save controller method

What is the difference between something being completely legal and being completely decriminalized?

label a part of commutative diagram

How do researchers send unsolicited emails asking for feedback on their works?

Why is "la Gestapo" feminine?

Asserting that Atheism and Theism are both faith based positions

Emojional cryptic crossword

Why is there so much iron?



Magento 2 404 on all pages/files (except homepage)


Magento 2 Wamp installation CSS/JS files return 404 error - multi storeStatic files aren't deploying in developer modeCss/js/font files not loading in the Admin area - except twoRefused to apply style “because its MIME type ('text/html') is not a supported stylesheet MIME type”Style sheet is not working when new theme is created in magento 2.2.5?Magento 2 : Refuse to apply style.less file not complied in .css file in magneto2Css not loading after theme installationInstalled magento 2.1 on windows but it is is giving many require js errorsI am getting jquery error while adding custom field in payment method in magento 2?













2















I setup a Ubuntu server with the LAMP at my home network for testing. I downloaded Magento-CE-2.2.0-2017-09-25-08-19-44.zip and extracted it into /var/www/html and started the installation process. The check was OK, I created the database, the hostname is set to 192.168.5.61, installation seemed to be OK.



But when I clicked the "Launch Magento Admin" at success page, it threw 404. So I visited 192.168.5.61 and the homepage showed, but it was only blank HTML - no styles or other things. I checked the page source code, the styles are linked there



<link rel="stylesheet" type="text/css" media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/mage/calendar.css" />
<link rel="stylesheet" type="text/css" media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-l.css" />
<link rel="stylesheet" type="text/css" media="print" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/print.css" />


But when I want to view the file, I got 404.
First I thought the .htaccess is missing/ignored, but .htaccess in Magento root has 322 lines and adding random characters to it causes an internal server error, so the .htaccess is working.



Next thing I checked was the /pub/static directory, where all the styles are linked to. But it seems to be a bit empty:



adam@ubuntu:/var/www/html$ tree pub/static
pub/static
├── deployed_version.txt
└── frontend
└── Magento
└── luma
└── en_US
└── requirejs-config.js


What I did wrong? How to fix it? Still didn't do any work, so deleting everything and starting over is acceptable, but tried 2 times and still the same result.



//EDIT:
Rafael Corrêa Gomes provided an answer on how to recreate the missing files. However, the problem is with permissions settings, as the installer has no permissions to modify the files it creates during installation. My problem is caused by Apache and permission, so it's a bit off-topic for this forums, as it has nothing to do with Magento.










share|improve this question
























  • Just to make sure, you deployed the static-content? Also is the server running on the same machine you try to access the magento site on?

    – AngelsDustz
    Sep 29 '17 at 20:49











  • @AngelsDustz How to deploy it? I don't remember doing so when I installed magento 2.1 in XAMPP.

    – Adam Ježek
    Sep 29 '17 at 20:53











  • When you freshly install a Magento 2 install, you have to run bin/magento setup:static-content:deploy if I remember correctly, you have to run said command from your Magento 2 root folder.

    – AngelsDustz
    Sep 29 '17 at 20:55











  • @AngelsDustz had to add -f to make it force (it said that deployment is not required in default mode), the /pub/static directory is now full, but the 404 is still there. If I remove the /versionXXXXXXXXXX/ from the .css path it is here, but homepage is still blank HTML and admin is still 404. Flushing cache had no effect.

    – Adam Ježek
    Sep 29 '17 at 21:00











  • I saw your edit in your question. I still think it is relevant in this forum since M2 developers always face such permission errors. For M2, CLI is also an essential part and that again increases the chance of this kind of error happening. So my point is, it is still relevant and you can see numerous question similar to this in this forum. Thanks for your question. Refer my answer below to go to the official doc. regarding the topic.

    – Rajeev K Tomy
    Oct 1 '17 at 3:18















2















I setup a Ubuntu server with the LAMP at my home network for testing. I downloaded Magento-CE-2.2.0-2017-09-25-08-19-44.zip and extracted it into /var/www/html and started the installation process. The check was OK, I created the database, the hostname is set to 192.168.5.61, installation seemed to be OK.



But when I clicked the "Launch Magento Admin" at success page, it threw 404. So I visited 192.168.5.61 and the homepage showed, but it was only blank HTML - no styles or other things. I checked the page source code, the styles are linked there



<link rel="stylesheet" type="text/css" media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/mage/calendar.css" />
<link rel="stylesheet" type="text/css" media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-l.css" />
<link rel="stylesheet" type="text/css" media="print" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/print.css" />


But when I want to view the file, I got 404.
First I thought the .htaccess is missing/ignored, but .htaccess in Magento root has 322 lines and adding random characters to it causes an internal server error, so the .htaccess is working.



Next thing I checked was the /pub/static directory, where all the styles are linked to. But it seems to be a bit empty:



adam@ubuntu:/var/www/html$ tree pub/static
pub/static
├── deployed_version.txt
└── frontend
└── Magento
└── luma
└── en_US
└── requirejs-config.js


What I did wrong? How to fix it? Still didn't do any work, so deleting everything and starting over is acceptable, but tried 2 times and still the same result.



//EDIT:
Rafael Corrêa Gomes provided an answer on how to recreate the missing files. However, the problem is with permissions settings, as the installer has no permissions to modify the files it creates during installation. My problem is caused by Apache and permission, so it's a bit off-topic for this forums, as it has nothing to do with Magento.










share|improve this question
























  • Just to make sure, you deployed the static-content? Also is the server running on the same machine you try to access the magento site on?

    – AngelsDustz
    Sep 29 '17 at 20:49











  • @AngelsDustz How to deploy it? I don't remember doing so when I installed magento 2.1 in XAMPP.

    – Adam Ježek
    Sep 29 '17 at 20:53











  • When you freshly install a Magento 2 install, you have to run bin/magento setup:static-content:deploy if I remember correctly, you have to run said command from your Magento 2 root folder.

    – AngelsDustz
    Sep 29 '17 at 20:55











  • @AngelsDustz had to add -f to make it force (it said that deployment is not required in default mode), the /pub/static directory is now full, but the 404 is still there. If I remove the /versionXXXXXXXXXX/ from the .css path it is here, but homepage is still blank HTML and admin is still 404. Flushing cache had no effect.

    – Adam Ježek
    Sep 29 '17 at 21:00











  • I saw your edit in your question. I still think it is relevant in this forum since M2 developers always face such permission errors. For M2, CLI is also an essential part and that again increases the chance of this kind of error happening. So my point is, it is still relevant and you can see numerous question similar to this in this forum. Thanks for your question. Refer my answer below to go to the official doc. regarding the topic.

    – Rajeev K Tomy
    Oct 1 '17 at 3:18













2












2








2


2






I setup a Ubuntu server with the LAMP at my home network for testing. I downloaded Magento-CE-2.2.0-2017-09-25-08-19-44.zip and extracted it into /var/www/html and started the installation process. The check was OK, I created the database, the hostname is set to 192.168.5.61, installation seemed to be OK.



But when I clicked the "Launch Magento Admin" at success page, it threw 404. So I visited 192.168.5.61 and the homepage showed, but it was only blank HTML - no styles or other things. I checked the page source code, the styles are linked there



<link rel="stylesheet" type="text/css" media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/mage/calendar.css" />
<link rel="stylesheet" type="text/css" media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-l.css" />
<link rel="stylesheet" type="text/css" media="print" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/print.css" />


But when I want to view the file, I got 404.
First I thought the .htaccess is missing/ignored, but .htaccess in Magento root has 322 lines and adding random characters to it causes an internal server error, so the .htaccess is working.



Next thing I checked was the /pub/static directory, where all the styles are linked to. But it seems to be a bit empty:



adam@ubuntu:/var/www/html$ tree pub/static
pub/static
├── deployed_version.txt
└── frontend
└── Magento
└── luma
└── en_US
└── requirejs-config.js


What I did wrong? How to fix it? Still didn't do any work, so deleting everything and starting over is acceptable, but tried 2 times and still the same result.



//EDIT:
Rafael Corrêa Gomes provided an answer on how to recreate the missing files. However, the problem is with permissions settings, as the installer has no permissions to modify the files it creates during installation. My problem is caused by Apache and permission, so it's a bit off-topic for this forums, as it has nothing to do with Magento.










share|improve this question
















I setup a Ubuntu server with the LAMP at my home network for testing. I downloaded Magento-CE-2.2.0-2017-09-25-08-19-44.zip and extracted it into /var/www/html and started the installation process. The check was OK, I created the database, the hostname is set to 192.168.5.61, installation seemed to be OK.



But when I clicked the "Launch Magento Admin" at success page, it threw 404. So I visited 192.168.5.61 and the homepage showed, but it was only blank HTML - no styles or other things. I checked the page source code, the styles are linked there



<link rel="stylesheet" type="text/css" media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/mage/calendar.css" />
<link rel="stylesheet" type="text/css" media="all" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 768px)" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/styles-l.css" />
<link rel="stylesheet" type="text/css" media="print" href="http://192.168.5.61/pub/static/version1506716871/frontend/Magento/luma/en_US/css/print.css" />


But when I want to view the file, I got 404.
First I thought the .htaccess is missing/ignored, but .htaccess in Magento root has 322 lines and adding random characters to it causes an internal server error, so the .htaccess is working.



Next thing I checked was the /pub/static directory, where all the styles are linked to. But it seems to be a bit empty:



adam@ubuntu:/var/www/html$ tree pub/static
pub/static
├── deployed_version.txt
└── frontend
└── Magento
└── luma
└── en_US
└── requirejs-config.js


What I did wrong? How to fix it? Still didn't do any work, so deleting everything and starting over is acceptable, but tried 2 times and still the same result.



//EDIT:
Rafael Corrêa Gomes provided an answer on how to recreate the missing files. However, the problem is with permissions settings, as the installer has no permissions to modify the files it creates during installation. My problem is caused by Apache and permission, so it's a bit off-topic for this forums, as it has nothing to do with Magento.







magento2 404 magento2.2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 30 '17 at 12:35







Adam Ježek

















asked Sep 29 '17 at 20:45









Adam JežekAdam Ježek

4218




4218












  • Just to make sure, you deployed the static-content? Also is the server running on the same machine you try to access the magento site on?

    – AngelsDustz
    Sep 29 '17 at 20:49











  • @AngelsDustz How to deploy it? I don't remember doing so when I installed magento 2.1 in XAMPP.

    – Adam Ježek
    Sep 29 '17 at 20:53











  • When you freshly install a Magento 2 install, you have to run bin/magento setup:static-content:deploy if I remember correctly, you have to run said command from your Magento 2 root folder.

    – AngelsDustz
    Sep 29 '17 at 20:55











  • @AngelsDustz had to add -f to make it force (it said that deployment is not required in default mode), the /pub/static directory is now full, but the 404 is still there. If I remove the /versionXXXXXXXXXX/ from the .css path it is here, but homepage is still blank HTML and admin is still 404. Flushing cache had no effect.

    – Adam Ježek
    Sep 29 '17 at 21:00











  • I saw your edit in your question. I still think it is relevant in this forum since M2 developers always face such permission errors. For M2, CLI is also an essential part and that again increases the chance of this kind of error happening. So my point is, it is still relevant and you can see numerous question similar to this in this forum. Thanks for your question. Refer my answer below to go to the official doc. regarding the topic.

    – Rajeev K Tomy
    Oct 1 '17 at 3:18

















  • Just to make sure, you deployed the static-content? Also is the server running on the same machine you try to access the magento site on?

    – AngelsDustz
    Sep 29 '17 at 20:49











  • @AngelsDustz How to deploy it? I don't remember doing so when I installed magento 2.1 in XAMPP.

    – Adam Ježek
    Sep 29 '17 at 20:53











  • When you freshly install a Magento 2 install, you have to run bin/magento setup:static-content:deploy if I remember correctly, you have to run said command from your Magento 2 root folder.

    – AngelsDustz
    Sep 29 '17 at 20:55











  • @AngelsDustz had to add -f to make it force (it said that deployment is not required in default mode), the /pub/static directory is now full, but the 404 is still there. If I remove the /versionXXXXXXXXXX/ from the .css path it is here, but homepage is still blank HTML and admin is still 404. Flushing cache had no effect.

    – Adam Ježek
    Sep 29 '17 at 21:00











  • I saw your edit in your question. I still think it is relevant in this forum since M2 developers always face such permission errors. For M2, CLI is also an essential part and that again increases the chance of this kind of error happening. So my point is, it is still relevant and you can see numerous question similar to this in this forum. Thanks for your question. Refer my answer below to go to the official doc. regarding the topic.

    – Rajeev K Tomy
    Oct 1 '17 at 3:18
















Just to make sure, you deployed the static-content? Also is the server running on the same machine you try to access the magento site on?

– AngelsDustz
Sep 29 '17 at 20:49





Just to make sure, you deployed the static-content? Also is the server running on the same machine you try to access the magento site on?

– AngelsDustz
Sep 29 '17 at 20:49













@AngelsDustz How to deploy it? I don't remember doing so when I installed magento 2.1 in XAMPP.

– Adam Ježek
Sep 29 '17 at 20:53





@AngelsDustz How to deploy it? I don't remember doing so when I installed magento 2.1 in XAMPP.

– Adam Ježek
Sep 29 '17 at 20:53













When you freshly install a Magento 2 install, you have to run bin/magento setup:static-content:deploy if I remember correctly, you have to run said command from your Magento 2 root folder.

– AngelsDustz
Sep 29 '17 at 20:55





When you freshly install a Magento 2 install, you have to run bin/magento setup:static-content:deploy if I remember correctly, you have to run said command from your Magento 2 root folder.

– AngelsDustz
Sep 29 '17 at 20:55













@AngelsDustz had to add -f to make it force (it said that deployment is not required in default mode), the /pub/static directory is now full, but the 404 is still there. If I remove the /versionXXXXXXXXXX/ from the .css path it is here, but homepage is still blank HTML and admin is still 404. Flushing cache had no effect.

– Adam Ježek
Sep 29 '17 at 21:00





@AngelsDustz had to add -f to make it force (it said that deployment is not required in default mode), the /pub/static directory is now full, but the 404 is still there. If I remove the /versionXXXXXXXXXX/ from the .css path it is here, but homepage is still blank HTML and admin is still 404. Flushing cache had no effect.

– Adam Ježek
Sep 29 '17 at 21:00













I saw your edit in your question. I still think it is relevant in this forum since M2 developers always face such permission errors. For M2, CLI is also an essential part and that again increases the chance of this kind of error happening. So my point is, it is still relevant and you can see numerous question similar to this in this forum. Thanks for your question. Refer my answer below to go to the official doc. regarding the topic.

– Rajeev K Tomy
Oct 1 '17 at 3:18





I saw your edit in your question. I still think it is relevant in this forum since M2 developers always face such permission errors. For M2, CLI is also an essential part and that again increases the chance of this kind of error happening. So my point is, it is still relevant and you can see numerous question similar to this in this forum. Thanks for your question. Refer my answer below to go to the official doc. regarding the topic.

– Rajeev K Tomy
Oct 1 '17 at 3:18










4 Answers
4






active

oldest

votes


















4














Seems like your URL_Rewrite isn't enabled.



Try using these commands in your folder /var/www/html:



alias mage="php -d memory_limit=-1 -f bin/magento";

chmod -R 775 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/;
composer install && composer update -vvvv;
mage deploy:mode:set developer;
mage config:set web/seo/use_rewrites 0;
mage setup:upgrade &&
mage cache:flush &&
mage indexer:reindex;
mage setup:static-content:deploy -f
chmod -R 775 pub/static/ pub/media/ var/


You can use just these commands if the issue is the folders permission:



find app/code pub/static app/etc var/generation var/di var/view_preprocessed vendor ( -type f -or -type d ) -exec chmod u-w ;
chmod o-rwx app/etc/env.php;
chmod u+x bin/magento





share|improve this answer

























  • composer requires login: Invalid credentials for 'https://repo.magento.com/packages.json', aborting., When I visit reop.magento.com in my browser, I am able to use my credentials to login, but they are denied in command line. Tried using both email or username as username.

    – Adam Ježek
    Sep 29 '17 at 21:21











  • @AdamJežek go to your magento account and create access key marketplace.magento.com/customer/accessKeys After this you can use Public Key and login and Private Key as password

    – Pavel Novitsky
    Sep 29 '17 at 21:32











  • It seems you code creates files that Magento installer didn't, but I figured out that this is not a Magento problem. For some reason, Magento installer has no write permission on the files it creates, so it fails. Have been messing with permission for last few hours, but it's off-topic for this forum. This is more superuser.com question, as something is f*cked up with apache.

    – Adam Ježek
    Sep 30 '17 at 12:32


















3














If you use Enterprise edition (Magento Commerce), maybe staging module data is screwed up. Try to remove staging row from the flag table.






share|improve this answer























  • Excellent, Working for me. Can you give some information for flag table?

    – Jimit Bhavsar
    Aug 6 '18 at 12:42












  • @Jimit what do you mean?

    – Roman Snitko
    Aug 7 '18 at 13:18











  • This worked for me aswell @RomanSnitko

    – Loxzibit
    Aug 29 '18 at 11:27



















2














It sounds like ownership or file access permission issue. While we run some commands or load a page, Magento generates some files into some particular directories and you need to make sure the ownership and permission of these directories as exactly described in the official documentation page.






share|improve this answer






























    1














    There are two reasons: 1: permission and owner
    2. .htaccess rewrite rules
    http://devdocs.magento.com/guides/v2.1/install-gde/prereq/file-sys-perms-over.html






    share|improve this answer
























      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
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f195341%2fmagento-2-404-on-all-pages-files-except-homepage%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4














      Seems like your URL_Rewrite isn't enabled.



      Try using these commands in your folder /var/www/html:



      alias mage="php -d memory_limit=-1 -f bin/magento";

      chmod -R 775 pub/static/ var/ pub/media/ &&
      rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/;
      composer install && composer update -vvvv;
      mage deploy:mode:set developer;
      mage config:set web/seo/use_rewrites 0;
      mage setup:upgrade &&
      mage cache:flush &&
      mage indexer:reindex;
      mage setup:static-content:deploy -f
      chmod -R 775 pub/static/ pub/media/ var/


      You can use just these commands if the issue is the folders permission:



      find app/code pub/static app/etc var/generation var/di var/view_preprocessed vendor ( -type f -or -type d ) -exec chmod u-w ;
      chmod o-rwx app/etc/env.php;
      chmod u+x bin/magento





      share|improve this answer

























      • composer requires login: Invalid credentials for 'https://repo.magento.com/packages.json', aborting., When I visit reop.magento.com in my browser, I am able to use my credentials to login, but they are denied in command line. Tried using both email or username as username.

        – Adam Ježek
        Sep 29 '17 at 21:21











      • @AdamJežek go to your magento account and create access key marketplace.magento.com/customer/accessKeys After this you can use Public Key and login and Private Key as password

        – Pavel Novitsky
        Sep 29 '17 at 21:32











      • It seems you code creates files that Magento installer didn't, but I figured out that this is not a Magento problem. For some reason, Magento installer has no write permission on the files it creates, so it fails. Have been messing with permission for last few hours, but it's off-topic for this forum. This is more superuser.com question, as something is f*cked up with apache.

        – Adam Ježek
        Sep 30 '17 at 12:32















      4














      Seems like your URL_Rewrite isn't enabled.



      Try using these commands in your folder /var/www/html:



      alias mage="php -d memory_limit=-1 -f bin/magento";

      chmod -R 775 pub/static/ var/ pub/media/ &&
      rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/;
      composer install && composer update -vvvv;
      mage deploy:mode:set developer;
      mage config:set web/seo/use_rewrites 0;
      mage setup:upgrade &&
      mage cache:flush &&
      mage indexer:reindex;
      mage setup:static-content:deploy -f
      chmod -R 775 pub/static/ pub/media/ var/


      You can use just these commands if the issue is the folders permission:



      find app/code pub/static app/etc var/generation var/di var/view_preprocessed vendor ( -type f -or -type d ) -exec chmod u-w ;
      chmod o-rwx app/etc/env.php;
      chmod u+x bin/magento





      share|improve this answer

























      • composer requires login: Invalid credentials for 'https://repo.magento.com/packages.json', aborting., When I visit reop.magento.com in my browser, I am able to use my credentials to login, but they are denied in command line. Tried using both email or username as username.

        – Adam Ježek
        Sep 29 '17 at 21:21











      • @AdamJežek go to your magento account and create access key marketplace.magento.com/customer/accessKeys After this you can use Public Key and login and Private Key as password

        – Pavel Novitsky
        Sep 29 '17 at 21:32











      • It seems you code creates files that Magento installer didn't, but I figured out that this is not a Magento problem. For some reason, Magento installer has no write permission on the files it creates, so it fails. Have been messing with permission for last few hours, but it's off-topic for this forum. This is more superuser.com question, as something is f*cked up with apache.

        – Adam Ježek
        Sep 30 '17 at 12:32













      4












      4








      4







      Seems like your URL_Rewrite isn't enabled.



      Try using these commands in your folder /var/www/html:



      alias mage="php -d memory_limit=-1 -f bin/magento";

      chmod -R 775 pub/static/ var/ pub/media/ &&
      rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/;
      composer install && composer update -vvvv;
      mage deploy:mode:set developer;
      mage config:set web/seo/use_rewrites 0;
      mage setup:upgrade &&
      mage cache:flush &&
      mage indexer:reindex;
      mage setup:static-content:deploy -f
      chmod -R 775 pub/static/ pub/media/ var/


      You can use just these commands if the issue is the folders permission:



      find app/code pub/static app/etc var/generation var/di var/view_preprocessed vendor ( -type f -or -type d ) -exec chmod u-w ;
      chmod o-rwx app/etc/env.php;
      chmod u+x bin/magento





      share|improve this answer















      Seems like your URL_Rewrite isn't enabled.



      Try using these commands in your folder /var/www/html:



      alias mage="php -d memory_limit=-1 -f bin/magento";

      chmod -R 775 pub/static/ var/ pub/media/ &&
      rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/;
      composer install && composer update -vvvv;
      mage deploy:mode:set developer;
      mage config:set web/seo/use_rewrites 0;
      mage setup:upgrade &&
      mage cache:flush &&
      mage indexer:reindex;
      mage setup:static-content:deploy -f
      chmod -R 775 pub/static/ pub/media/ var/


      You can use just these commands if the issue is the folders permission:



      find app/code pub/static app/etc var/generation var/di var/view_preprocessed vendor ( -type f -or -type d ) -exec chmod u-w ;
      chmod o-rwx app/etc/env.php;
      chmod u+x bin/magento






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited 15 hours ago

























      answered Sep 29 '17 at 20:56









      Rafael Corrêa GomesRafael Corrêa Gomes

      4,59223265




      4,59223265












      • composer requires login: Invalid credentials for 'https://repo.magento.com/packages.json', aborting., When I visit reop.magento.com in my browser, I am able to use my credentials to login, but they are denied in command line. Tried using both email or username as username.

        – Adam Ježek
        Sep 29 '17 at 21:21











      • @AdamJežek go to your magento account and create access key marketplace.magento.com/customer/accessKeys After this you can use Public Key and login and Private Key as password

        – Pavel Novitsky
        Sep 29 '17 at 21:32











      • It seems you code creates files that Magento installer didn't, but I figured out that this is not a Magento problem. For some reason, Magento installer has no write permission on the files it creates, so it fails. Have been messing with permission for last few hours, but it's off-topic for this forum. This is more superuser.com question, as something is f*cked up with apache.

        – Adam Ježek
        Sep 30 '17 at 12:32

















      • composer requires login: Invalid credentials for 'https://repo.magento.com/packages.json', aborting., When I visit reop.magento.com in my browser, I am able to use my credentials to login, but they are denied in command line. Tried using both email or username as username.

        – Adam Ježek
        Sep 29 '17 at 21:21











      • @AdamJežek go to your magento account and create access key marketplace.magento.com/customer/accessKeys After this you can use Public Key and login and Private Key as password

        – Pavel Novitsky
        Sep 29 '17 at 21:32











      • It seems you code creates files that Magento installer didn't, but I figured out that this is not a Magento problem. For some reason, Magento installer has no write permission on the files it creates, so it fails. Have been messing with permission for last few hours, but it's off-topic for this forum. This is more superuser.com question, as something is f*cked up with apache.

        – Adam Ježek
        Sep 30 '17 at 12:32
















      composer requires login: Invalid credentials for 'https://repo.magento.com/packages.json', aborting., When I visit reop.magento.com in my browser, I am able to use my credentials to login, but they are denied in command line. Tried using both email or username as username.

      – Adam Ježek
      Sep 29 '17 at 21:21





      composer requires login: Invalid credentials for 'https://repo.magento.com/packages.json', aborting., When I visit reop.magento.com in my browser, I am able to use my credentials to login, but they are denied in command line. Tried using both email or username as username.

      – Adam Ježek
      Sep 29 '17 at 21:21













      @AdamJežek go to your magento account and create access key marketplace.magento.com/customer/accessKeys After this you can use Public Key and login and Private Key as password

      – Pavel Novitsky
      Sep 29 '17 at 21:32





      @AdamJežek go to your magento account and create access key marketplace.magento.com/customer/accessKeys After this you can use Public Key and login and Private Key as password

      – Pavel Novitsky
      Sep 29 '17 at 21:32













      It seems you code creates files that Magento installer didn't, but I figured out that this is not a Magento problem. For some reason, Magento installer has no write permission on the files it creates, so it fails. Have been messing with permission for last few hours, but it's off-topic for this forum. This is more superuser.com question, as something is f*cked up with apache.

      – Adam Ježek
      Sep 30 '17 at 12:32





      It seems you code creates files that Magento installer didn't, but I figured out that this is not a Magento problem. For some reason, Magento installer has no write permission on the files it creates, so it fails. Have been messing with permission for last few hours, but it's off-topic for this forum. This is more superuser.com question, as something is f*cked up with apache.

      – Adam Ježek
      Sep 30 '17 at 12:32













      3














      If you use Enterprise edition (Magento Commerce), maybe staging module data is screwed up. Try to remove staging row from the flag table.






      share|improve this answer























      • Excellent, Working for me. Can you give some information for flag table?

        – Jimit Bhavsar
        Aug 6 '18 at 12:42












      • @Jimit what do you mean?

        – Roman Snitko
        Aug 7 '18 at 13:18











      • This worked for me aswell @RomanSnitko

        – Loxzibit
        Aug 29 '18 at 11:27
















      3














      If you use Enterprise edition (Magento Commerce), maybe staging module data is screwed up. Try to remove staging row from the flag table.






      share|improve this answer























      • Excellent, Working for me. Can you give some information for flag table?

        – Jimit Bhavsar
        Aug 6 '18 at 12:42












      • @Jimit what do you mean?

        – Roman Snitko
        Aug 7 '18 at 13:18











      • This worked for me aswell @RomanSnitko

        – Loxzibit
        Aug 29 '18 at 11:27














      3












      3








      3







      If you use Enterprise edition (Magento Commerce), maybe staging module data is screwed up. Try to remove staging row from the flag table.






      share|improve this answer













      If you use Enterprise edition (Magento Commerce), maybe staging module data is screwed up. Try to remove staging row from the flag table.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Nov 9 '17 at 14:56









      Roman SnitkoRoman Snitko

      374212




      374212












      • Excellent, Working for me. Can you give some information for flag table?

        – Jimit Bhavsar
        Aug 6 '18 at 12:42












      • @Jimit what do you mean?

        – Roman Snitko
        Aug 7 '18 at 13:18











      • This worked for me aswell @RomanSnitko

        – Loxzibit
        Aug 29 '18 at 11:27


















      • Excellent, Working for me. Can you give some information for flag table?

        – Jimit Bhavsar
        Aug 6 '18 at 12:42












      • @Jimit what do you mean?

        – Roman Snitko
        Aug 7 '18 at 13:18











      • This worked for me aswell @RomanSnitko

        – Loxzibit
        Aug 29 '18 at 11:27

















      Excellent, Working for me. Can you give some information for flag table?

      – Jimit Bhavsar
      Aug 6 '18 at 12:42






      Excellent, Working for me. Can you give some information for flag table?

      – Jimit Bhavsar
      Aug 6 '18 at 12:42














      @Jimit what do you mean?

      – Roman Snitko
      Aug 7 '18 at 13:18





      @Jimit what do you mean?

      – Roman Snitko
      Aug 7 '18 at 13:18













      This worked for me aswell @RomanSnitko

      – Loxzibit
      Aug 29 '18 at 11:27






      This worked for me aswell @RomanSnitko

      – Loxzibit
      Aug 29 '18 at 11:27












      2














      It sounds like ownership or file access permission issue. While we run some commands or load a page, Magento generates some files into some particular directories and you need to make sure the ownership and permission of these directories as exactly described in the official documentation page.






      share|improve this answer



























        2














        It sounds like ownership or file access permission issue. While we run some commands or load a page, Magento generates some files into some particular directories and you need to make sure the ownership and permission of these directories as exactly described in the official documentation page.






        share|improve this answer

























          2












          2








          2







          It sounds like ownership or file access permission issue. While we run some commands or load a page, Magento generates some files into some particular directories and you need to make sure the ownership and permission of these directories as exactly described in the official documentation page.






          share|improve this answer













          It sounds like ownership or file access permission issue. While we run some commands or load a page, Magento generates some files into some particular directories and you need to make sure the ownership and permission of these directories as exactly described in the official documentation page.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 30 '17 at 5:56









          Rajeev K TomyRajeev K Tomy

          14.6k54589




          14.6k54589





















              1














              There are two reasons: 1: permission and owner
              2. .htaccess rewrite rules
              http://devdocs.magento.com/guides/v2.1/install-gde/prereq/file-sys-perms-over.html






              share|improve this answer





























                1














                There are two reasons: 1: permission and owner
                2. .htaccess rewrite rules
                http://devdocs.magento.com/guides/v2.1/install-gde/prereq/file-sys-perms-over.html






                share|improve this answer



























                  1












                  1








                  1







                  There are two reasons: 1: permission and owner
                  2. .htaccess rewrite rules
                  http://devdocs.magento.com/guides/v2.1/install-gde/prereq/file-sys-perms-over.html






                  share|improve this answer















                  There are two reasons: 1: permission and owner
                  2. .htaccess rewrite rules
                  http://devdocs.magento.com/guides/v2.1/install-gde/prereq/file-sys-perms-over.html







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  answered Nov 9 '17 at 15:39


























                  community wiki





                  Pramod Kharade




























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f195341%2fmagento-2-404-on-all-pages-files-except-homepage%23new-answer', 'question_page');

                      );

                      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







                      Popular posts from this blog

                      Sum ergo cogito? 1 nng

                      419 nièngy_Soadمي 19bal1.5o_g

                      Queiggey Chernihivv 9NnOo i Zw X QqKk LpB