I am a beginner in Magento Magento 2. I'm trying to learn how to develop module for mage but I have problem with custom routing in module.
Here's what I've done:
- I cloned from their repo and installed by the composer.
- I downloaded the 'sample-module-newpage' from the repo https://github.com/magento/magento2-samples
- I placed sample-module-newpage in the app/code/Magento/sample-module-newpage.
- Then I enable the module with command:
enable Magento_SampleNewPage
- Then I was executed command
magento setup:update
Now couple things:
In Magento backoffice stores -> configuration -> advanced -> advanced in section Disable Modules Output I can see that Magento_SampleNewPage is enabled
I disabled Magento cache
I'm not sure if it should look like this but to the admin panel I get through exaple.com/index.php/admin
After installation Magento wasn't able to load css and js depedencies because of wrong file path. To fix this I was run two commands
magento setup:static-content:deploy
andmagento indexer:reindex
My problem
I'm not able to access example page which is created by my module. Readme says that page can be accessed at /newpage but I'm getting apache 404. I've tried also at /index.php/newpage but I'm getting magento error that page doesn't exists.
What I'm doing wrong?
index.php
. Did you enable Apache rewrites?var
folder after adding module to magento is not enough. After adding new module to magento 2, I am executing folowing commandsphp bin/magento setup:upgrade
then I am clearingvar
folder and at the end I'm setting chmods agin with following commandssudo chmod -R 777 var
sudo chmod -R 777 app/etc
sudo chmod -R 777 pub
. Thank you all for your help.