This is registration.php
<?php
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE,'Mymodule_Newmodule1', __DIR__);
routes.xml file is here
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="module1" frontName="module1">
<module name="Mymodule_Newmodule1" />
</route>
</router>
</config>
Here is the controller file
<?php
namespace Mymodules\Newmodule1\Controller\Page;
class Helloworld extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $pageFactory
) {
$this->_pageFactory = $pageFactory;
return parent::__construct($context);
}
public function execute()
{
echo "Hello world";
exit;
}
}
When i check in browser it show 404
My base url newsite.new1 newsite.new1/module1/page/helloworld returns 404