Redirecting homepageOverriding a core controller's preDispatch methodMake the store my homepage?Huge Magento2 permissions issueDefine custom homepageHomepage ContentHo to set multistore configuration in Magento 2 to have domain.com and domain.com/storecode/Add Cross Sell Block to Checkout Step Magento 2Immense slow / hanging query when searching Magento 2How to get a good Google Pagespeed mobile score for a Magento2 site?How to show full product page on home (but show different custom block than product page)
How to get the similar sounding words together
What is this type of notehead called?
We have a love-hate relationship
Has Darkwing Duck ever met Scrooge McDuck?
Proof of Lemma: Every nonzero integer can be written as a product of primes
Does having a TSA Pre-Check member in your flight reservation increase the chances that everyone gets Pre-Check?
Melting point of aspirin, contradicting sources
Generating adjacency matrices from isomorphic graphs
Query about absorption line spectra
Can somebody explain Brexit in a few child-proof sentences?
Some numbers are more equivalent than others
How do ground effect vehicles perform turns?
Journal losing indexing services
How to align and center standalone amsmath equations?
Flux received by a negative charge
How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?
Drawing ramified coverings with tikz
THT: What is a squared annular “ring”?
How can "mimic phobia" be cured or prevented?
How should I respond when I lied about my education and the company finds out through background check?
Reply 'no position' while the job posting is still there
Transformation of random variables and joint distributions
Could the E-bike drivetrain wear down till needing replacement after 400 km?
Customize circled numbers
Redirecting homepage
Overriding a core controller's preDispatch methodMake the store my homepage?Huge Magento2 permissions issueDefine custom homepageHomepage ContentHo to set multistore configuration in Magento 2 to have domain.com and domain.com/storecode/Add Cross Sell Block to Checkout Step Magento 2Immense slow / hanging query when searching Magento 2How to get a good Google Pagespeed mobile score for a Magento2 site?How to show full product page on home (but show different custom block than product page)
I'm completely new to magento (used wordpress a lot before and sites from scratch) and I cannot understand how to change the homepage so it will show the sign in page. I'm using the standard luna theme, so there is already an existing page I would like to redirect the controller to the sign in URL but for the life of me can't understand the architecture. Hoping solving this simple problem will help me understand magento better.
Thanks in advance
magento2 controllers home
add a comment |
I'm completely new to magento (used wordpress a lot before and sites from scratch) and I cannot understand how to change the homepage so it will show the sign in page. I'm using the standard luna theme, so there is already an existing page I would like to redirect the controller to the sign in URL but for the life of me can't understand the architecture. Hoping solving this simple problem will help me understand magento better.
Thanks in advance
magento2 controllers home
are you looking programmatic solution? it is possible from admin too.
– Bilal Usean
Sep 13 '16 at 15:35
I would like a programmatic solution. I feel like it would help me understand how things work in a practical way. Thanks!
– N. Mantel
Sep 13 '16 at 16:05
add a comment |
I'm completely new to magento (used wordpress a lot before and sites from scratch) and I cannot understand how to change the homepage so it will show the sign in page. I'm using the standard luna theme, so there is already an existing page I would like to redirect the controller to the sign in URL but for the life of me can't understand the architecture. Hoping solving this simple problem will help me understand magento better.
Thanks in advance
magento2 controllers home
I'm completely new to magento (used wordpress a lot before and sites from scratch) and I cannot understand how to change the homepage so it will show the sign in page. I'm using the standard luna theme, so there is already an existing page I would like to redirect the controller to the sign in URL but for the life of me can't understand the architecture. Hoping solving this simple problem will help me understand magento better.
Thanks in advance
magento2 controllers home
magento2 controllers home
asked Sep 13 '16 at 14:46
N. MantelN. Mantel
235
235
are you looking programmatic solution? it is possible from admin too.
– Bilal Usean
Sep 13 '16 at 15:35
I would like a programmatic solution. I feel like it would help me understand how things work in a practical way. Thanks!
– N. Mantel
Sep 13 '16 at 16:05
add a comment |
are you looking programmatic solution? it is possible from admin too.
– Bilal Usean
Sep 13 '16 at 15:35
I would like a programmatic solution. I feel like it would help me understand how things work in a practical way. Thanks!
– N. Mantel
Sep 13 '16 at 16:05
are you looking programmatic solution? it is possible from admin too.
– Bilal Usean
Sep 13 '16 at 15:35
are you looking programmatic solution? it is possible from admin too.
– Bilal Usean
Sep 13 '16 at 15:35
I would like a programmatic solution. I feel like it would help me understand how things work in a practical way. Thanks!
– N. Mantel
Sep 13 '16 at 16:05
I would like a programmatic solution. I feel like it would help me understand how things work in a practical way. Thanks!
– N. Mantel
Sep 13 '16 at 16:05
add a comment |
2 Answers
2
active
oldest
votes
First create simple module, refer this link for step by step implementation after that follow the instruction.
Default home page for luma is cms/index/index, so you need to override that controller in order to redirect.
for override the controler add the below content in your app/code/vendor/namespace/etc/di.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="MagentoCmsControllerIndexIndex" type="MyVendorMyNamespaceControlerIndexRedirecthome" />
</config>
New Custom Controller: app/code/Vendor/namespace/Controler/Index/Redirecthome.php
<?php
namespace MyVendorMyNamespaceControllerIndex;
class Redirecthome extends MagentoFrameworkAppActionAction
protected $resultForwardFactory;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
)
$this->resultForwardFactory = $resultForwardFactory;
parent::__construct($context);
public function execute($coreRoute = null)
$this->_redirect('customer/account/login');
return;
Now the home page use the above controller instead of default. I have tested it works.
From Admin: It is possible from admin too
Home Page:
store -> configuration -> General -> Web -> Default pages -> here you can chnge **cms** to **customer/account/login**
Redirection
marketing -> url rewrite -> add new url rewrite -> here you can set request path as **cms** and target path as **customer/account/login**
Thank you that was extremely helpful in all the magento chaos!
– N. Mantel
Sep 13 '16 at 18:33
add a comment |
Better solution is not writing any extra code.
Go to Admin Page.
Select Marketing => URL Rewrites
Click on Add URL Rewrites
Set Create URL Rewrite to "Custom"
Store as "Default Store view".
Request Path as ""
Target Path as "Whatever you want"
Redirect Type "Whatever you want"
Description as "Whatever you want"
Save it. And check. No need to write some extra stuff.
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');
);
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%2f136116%2fredirecting-homepage%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
First create simple module, refer this link for step by step implementation after that follow the instruction.
Default home page for luma is cms/index/index, so you need to override that controller in order to redirect.
for override the controler add the below content in your app/code/vendor/namespace/etc/di.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="MagentoCmsControllerIndexIndex" type="MyVendorMyNamespaceControlerIndexRedirecthome" />
</config>
New Custom Controller: app/code/Vendor/namespace/Controler/Index/Redirecthome.php
<?php
namespace MyVendorMyNamespaceControllerIndex;
class Redirecthome extends MagentoFrameworkAppActionAction
protected $resultForwardFactory;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
)
$this->resultForwardFactory = $resultForwardFactory;
parent::__construct($context);
public function execute($coreRoute = null)
$this->_redirect('customer/account/login');
return;
Now the home page use the above controller instead of default. I have tested it works.
From Admin: It is possible from admin too
Home Page:
store -> configuration -> General -> Web -> Default pages -> here you can chnge **cms** to **customer/account/login**
Redirection
marketing -> url rewrite -> add new url rewrite -> here you can set request path as **cms** and target path as **customer/account/login**
Thank you that was extremely helpful in all the magento chaos!
– N. Mantel
Sep 13 '16 at 18:33
add a comment |
First create simple module, refer this link for step by step implementation after that follow the instruction.
Default home page for luma is cms/index/index, so you need to override that controller in order to redirect.
for override the controler add the below content in your app/code/vendor/namespace/etc/di.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="MagentoCmsControllerIndexIndex" type="MyVendorMyNamespaceControlerIndexRedirecthome" />
</config>
New Custom Controller: app/code/Vendor/namespace/Controler/Index/Redirecthome.php
<?php
namespace MyVendorMyNamespaceControllerIndex;
class Redirecthome extends MagentoFrameworkAppActionAction
protected $resultForwardFactory;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
)
$this->resultForwardFactory = $resultForwardFactory;
parent::__construct($context);
public function execute($coreRoute = null)
$this->_redirect('customer/account/login');
return;
Now the home page use the above controller instead of default. I have tested it works.
From Admin: It is possible from admin too
Home Page:
store -> configuration -> General -> Web -> Default pages -> here you can chnge **cms** to **customer/account/login**
Redirection
marketing -> url rewrite -> add new url rewrite -> here you can set request path as **cms** and target path as **customer/account/login**
Thank you that was extremely helpful in all the magento chaos!
– N. Mantel
Sep 13 '16 at 18:33
add a comment |
First create simple module, refer this link for step by step implementation after that follow the instruction.
Default home page for luma is cms/index/index, so you need to override that controller in order to redirect.
for override the controler add the below content in your app/code/vendor/namespace/etc/di.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="MagentoCmsControllerIndexIndex" type="MyVendorMyNamespaceControlerIndexRedirecthome" />
</config>
New Custom Controller: app/code/Vendor/namespace/Controler/Index/Redirecthome.php
<?php
namespace MyVendorMyNamespaceControllerIndex;
class Redirecthome extends MagentoFrameworkAppActionAction
protected $resultForwardFactory;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
)
$this->resultForwardFactory = $resultForwardFactory;
parent::__construct($context);
public function execute($coreRoute = null)
$this->_redirect('customer/account/login');
return;
Now the home page use the above controller instead of default. I have tested it works.
From Admin: It is possible from admin too
Home Page:
store -> configuration -> General -> Web -> Default pages -> here you can chnge **cms** to **customer/account/login**
Redirection
marketing -> url rewrite -> add new url rewrite -> here you can set request path as **cms** and target path as **customer/account/login**
First create simple module, refer this link for step by step implementation after that follow the instruction.
Default home page for luma is cms/index/index, so you need to override that controller in order to redirect.
for override the controler add the below content in your app/code/vendor/namespace/etc/di.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="MagentoCmsControllerIndexIndex" type="MyVendorMyNamespaceControlerIndexRedirecthome" />
</config>
New Custom Controller: app/code/Vendor/namespace/Controler/Index/Redirecthome.php
<?php
namespace MyVendorMyNamespaceControllerIndex;
class Redirecthome extends MagentoFrameworkAppActionAction
protected $resultForwardFactory;
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
)
$this->resultForwardFactory = $resultForwardFactory;
parent::__construct($context);
public function execute($coreRoute = null)
$this->_redirect('customer/account/login');
return;
Now the home page use the above controller instead of default. I have tested it works.
From Admin: It is possible from admin too
Home Page:
store -> configuration -> General -> Web -> Default pages -> here you can chnge **cms** to **customer/account/login**
Redirection
marketing -> url rewrite -> add new url rewrite -> here you can set request path as **cms** and target path as **customer/account/login**
answered Sep 13 '16 at 17:07
Bilal UseanBilal Usean
5,09233690
5,09233690
Thank you that was extremely helpful in all the magento chaos!
– N. Mantel
Sep 13 '16 at 18:33
add a comment |
Thank you that was extremely helpful in all the magento chaos!
– N. Mantel
Sep 13 '16 at 18:33
Thank you that was extremely helpful in all the magento chaos!
– N. Mantel
Sep 13 '16 at 18:33
Thank you that was extremely helpful in all the magento chaos!
– N. Mantel
Sep 13 '16 at 18:33
add a comment |
Better solution is not writing any extra code.
Go to Admin Page.
Select Marketing => URL Rewrites
Click on Add URL Rewrites
Set Create URL Rewrite to "Custom"
Store as "Default Store view".
Request Path as ""
Target Path as "Whatever you want"
Redirect Type "Whatever you want"
Description as "Whatever you want"
Save it. And check. No need to write some extra stuff.
add a comment |
Better solution is not writing any extra code.
Go to Admin Page.
Select Marketing => URL Rewrites
Click on Add URL Rewrites
Set Create URL Rewrite to "Custom"
Store as "Default Store view".
Request Path as ""
Target Path as "Whatever you want"
Redirect Type "Whatever you want"
Description as "Whatever you want"
Save it. And check. No need to write some extra stuff.
add a comment |
Better solution is not writing any extra code.
Go to Admin Page.
Select Marketing => URL Rewrites
Click on Add URL Rewrites
Set Create URL Rewrite to "Custom"
Store as "Default Store view".
Request Path as ""
Target Path as "Whatever you want"
Redirect Type "Whatever you want"
Description as "Whatever you want"
Save it. And check. No need to write some extra stuff.
Better solution is not writing any extra code.
Go to Admin Page.
Select Marketing => URL Rewrites
Click on Add URL Rewrites
Set Create URL Rewrite to "Custom"
Store as "Default Store view".
Request Path as ""
Target Path as "Whatever you want"
Redirect Type "Whatever you want"
Description as "Whatever you want"
Save it. And check. No need to write some extra stuff.
answered 4 mins ago
Avesh NaikAvesh Naik
37812
37812
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');
);
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%2f136116%2fredirecting-homepage%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');
);
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');
);
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');
);
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
are you looking programmatic solution? it is possible from admin too.
– Bilal Usean
Sep 13 '16 at 15:35
I would like a programmatic solution. I feel like it would help me understand how things work in a practical way. Thanks!
– N. Mantel
Sep 13 '16 at 16:05