Redirecting to 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)

In Star Trek IV, why did the Bounty go back to a time when whales were already rare?

On a tidally locked planet, would time be quantized?

Flux received by a negative charge

Proof of Lemma: Every nonzero integer can be written as a product of primes

Is it improper etiquette to ask your opponent what his/her rating is before the game?

Using a siddur to Daven from in a seforim store

How much character growth crosses the line into breaking the character

How do I extrude a face to a single vertex

Difference between -| and |- in TikZ

Indicating multiple different modes of speech (fantasy language or telepathy)

Diode in opposite direction?

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

Have I saved too much for retirement so far?

Drawing ramified coverings with tikz

Melting point of aspirin, contradicting sources

What linear sensor for a keyboard?

A social experiment. What is the worst that can happen?

Why do IPv6 unique local addresses have to have a /48 prefix?

Is there a word to describe the feeling of being transfixed out of horror?

Can somebody explain Brexit in a few child-proof sentences?

Did US corporations pay demonstrators in the German demonstrations against article 13?

Could solar power be utilized and substitute coal in the 19th century?

What is this type of notehead called?

Does having a TSA Pre-Check member in your flight reservation increase the chances that everyone gets Pre-Check?



Redirecting to 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)













1















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 luma 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 to solve this simple problem. Please help me understand Magento better.

Thanks in advance










share|improve this question
























  • 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
















1















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 luma 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 to solve this simple problem. Please help me understand Magento better.

Thanks in advance










share|improve this question
























  • 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














1












1








1








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 luma 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 to solve this simple problem. Please help me understand Magento better.

Thanks in advance










share|improve this question
















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 luma 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 to solve this simple problem. Please help me understand Magento better.

Thanks in advance







magento2 controllers home






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 11 mins ago









magefms

1,9271425




1,9271425










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


















  • 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











2 Answers
2






active

oldest

votes


















1














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**





share|improve this answer























  • Thank you that was extremely helpful in all the magento chaos!

    – N. Mantel
    Sep 13 '16 at 18:33


















0














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.






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%2f136116%2fredirecting-to-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









    1














    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**





    share|improve this answer























    • Thank you that was extremely helpful in all the magento chaos!

      – N. Mantel
      Sep 13 '16 at 18:33















    1














    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**





    share|improve this answer























    • Thank you that was extremely helpful in all the magento chaos!

      – N. Mantel
      Sep 13 '16 at 18:33













    1












    1








    1







    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**





    share|improve this answer













    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**






    share|improve this answer












    share|improve this answer



    share|improve this answer










    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

















    • 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













    0














    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.






    share|improve this answer



























      0














      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.






      share|improve this answer

























        0












        0








        0







        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.






        share|improve this answer













        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 20 mins ago









        Avesh NaikAvesh Naik

        37812




        37812



























            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%2f136116%2fredirecting-to-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

            Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

            Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

            How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2