Magento 2: Redirect from Category Page to CMS Page












1















I already gone through How to redirect a category to another link



Still i have issue. In my .htaccess , in <IfModule mod_rewrite.c> before end of </IfModule>



i wrote



Redirect 301 /subcart/product.html http://localhost/magento2/testcmspage









share|improve this question

























  • Did you tried in URL rewrite management?

    – saravanavelu
    Nov 7 '16 at 8:37











  • Yes. I tried. But it's giving same error as mentioned in reference link. So no other way apart from htaccess

    – Ankit Shah
    Nov 7 '16 at 8:38











  • yes. You have to change the product.html which is existing already to other one and create the new URL rewrite for product.html. I also got the same error in URL rewrite. Then I changed the existing URL and the redirection is working

    – saravanavelu
    Nov 7 '16 at 8:47













  • Can you please post your detailed answer with explanation please

    – Ankit Shah
    Nov 7 '16 at 8:56
















1















I already gone through How to redirect a category to another link



Still i have issue. In my .htaccess , in <IfModule mod_rewrite.c> before end of </IfModule>



i wrote



Redirect 301 /subcart/product.html http://localhost/magento2/testcmspage









share|improve this question

























  • Did you tried in URL rewrite management?

    – saravanavelu
    Nov 7 '16 at 8:37











  • Yes. I tried. But it's giving same error as mentioned in reference link. So no other way apart from htaccess

    – Ankit Shah
    Nov 7 '16 at 8:38











  • yes. You have to change the product.html which is existing already to other one and create the new URL rewrite for product.html. I also got the same error in URL rewrite. Then I changed the existing URL and the redirection is working

    – saravanavelu
    Nov 7 '16 at 8:47













  • Can you please post your detailed answer with explanation please

    – Ankit Shah
    Nov 7 '16 at 8:56














1












1








1








I already gone through How to redirect a category to another link



Still i have issue. In my .htaccess , in <IfModule mod_rewrite.c> before end of </IfModule>



i wrote



Redirect 301 /subcart/product.html http://localhost/magento2/testcmspage









share|improve this question
















I already gone through How to redirect a category to another link



Still i have issue. In my .htaccess , in <IfModule mod_rewrite.c> before end of </IfModule>



i wrote



Redirect 301 /subcart/product.html http://localhost/magento2/testcmspage






magento2 category cms redirect htaccess






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:55









Community

1




1










asked Nov 7 '16 at 7:28









Ankit ShahAnkit Shah

4,710862140




4,710862140













  • Did you tried in URL rewrite management?

    – saravanavelu
    Nov 7 '16 at 8:37











  • Yes. I tried. But it's giving same error as mentioned in reference link. So no other way apart from htaccess

    – Ankit Shah
    Nov 7 '16 at 8:38











  • yes. You have to change the product.html which is existing already to other one and create the new URL rewrite for product.html. I also got the same error in URL rewrite. Then I changed the existing URL and the redirection is working

    – saravanavelu
    Nov 7 '16 at 8:47













  • Can you please post your detailed answer with explanation please

    – Ankit Shah
    Nov 7 '16 at 8:56



















  • Did you tried in URL rewrite management?

    – saravanavelu
    Nov 7 '16 at 8:37











  • Yes. I tried. But it's giving same error as mentioned in reference link. So no other way apart from htaccess

    – Ankit Shah
    Nov 7 '16 at 8:38











  • yes. You have to change the product.html which is existing already to other one and create the new URL rewrite for product.html. I also got the same error in URL rewrite. Then I changed the existing URL and the redirection is working

    – saravanavelu
    Nov 7 '16 at 8:47













  • Can you please post your detailed answer with explanation please

    – Ankit Shah
    Nov 7 '16 at 8:56

















Did you tried in URL rewrite management?

– saravanavelu
Nov 7 '16 at 8:37





Did you tried in URL rewrite management?

– saravanavelu
Nov 7 '16 at 8:37













Yes. I tried. But it's giving same error as mentioned in reference link. So no other way apart from htaccess

– Ankit Shah
Nov 7 '16 at 8:38





Yes. I tried. But it's giving same error as mentioned in reference link. So no other way apart from htaccess

– Ankit Shah
Nov 7 '16 at 8:38













yes. You have to change the product.html which is existing already to other one and create the new URL rewrite for product.html. I also got the same error in URL rewrite. Then I changed the existing URL and the redirection is working

– saravanavelu
Nov 7 '16 at 8:47







yes. You have to change the product.html which is existing already to other one and create the new URL rewrite for product.html. I also got the same error in URL rewrite. Then I changed the existing URL and the redirection is working

– saravanavelu
Nov 7 '16 at 8:47















Can you please post your detailed answer with explanation please

– Ankit Shah
Nov 7 '16 at 8:56





Can you please post your detailed answer with explanation please

– Ankit Shah
Nov 7 '16 at 8:56










2 Answers
2






active

oldest

votes


















2














Try this,



1) Under Marketing-> URL rewrites search products.html under Request Path column. Then edit that and change the request path URL as products-old.html and then click save.



2) Create the new URL rewrite as like below screenshot and then click save.



enter image description here






share|improve this answer
























  • Nope it's not working for Me. It's adding that value but on frontend it's not redirecting

    – Ankit Shah
    Nov 7 '16 at 9:15











  • Did you tried reindex and clearing cache and generation folders?

    – saravanavelu
    Nov 7 '16 at 9:25











  • Yes i already tried

    – Ankit Shah
    Nov 7 '16 at 9:26



















0














the trick to this is:




  1. Go to ROOT folder of magento 2

  2. Open .httaccess file


  3. Add following line (IMPORTANT!!! MAKE SURE TO ADD IT TO BEGINING
    OF THE FILE, FIRST LINE IS BEST, OTHERWISE IT WILL NOT WORK
    , Replace the first link with your category link and second the page you wish to redirect to):



    RewriteRule catalog/category/view/s/example/id/213/ https://example.com/example [L,R=301]



Save and enter following commands in the command tool:



    php bin/magento indexer:reindex
php bin/magento cache:clean
php bin/magento cache:flush


I was fighting with this, but all this time the trick was to add the line at the beggining of the .htaccess file. I was adding it at the end (last line)






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%2f144437%2fmagento-2-redirect-from-category-page-to-cms-page%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









    2














    Try this,



    1) Under Marketing-> URL rewrites search products.html under Request Path column. Then edit that and change the request path URL as products-old.html and then click save.



    2) Create the new URL rewrite as like below screenshot and then click save.



    enter image description here






    share|improve this answer
























    • Nope it's not working for Me. It's adding that value but on frontend it's not redirecting

      – Ankit Shah
      Nov 7 '16 at 9:15











    • Did you tried reindex and clearing cache and generation folders?

      – saravanavelu
      Nov 7 '16 at 9:25











    • Yes i already tried

      – Ankit Shah
      Nov 7 '16 at 9:26
















    2














    Try this,



    1) Under Marketing-> URL rewrites search products.html under Request Path column. Then edit that and change the request path URL as products-old.html and then click save.



    2) Create the new URL rewrite as like below screenshot and then click save.



    enter image description here






    share|improve this answer
























    • Nope it's not working for Me. It's adding that value but on frontend it's not redirecting

      – Ankit Shah
      Nov 7 '16 at 9:15











    • Did you tried reindex and clearing cache and generation folders?

      – saravanavelu
      Nov 7 '16 at 9:25











    • Yes i already tried

      – Ankit Shah
      Nov 7 '16 at 9:26














    2












    2








    2







    Try this,



    1) Under Marketing-> URL rewrites search products.html under Request Path column. Then edit that and change the request path URL as products-old.html and then click save.



    2) Create the new URL rewrite as like below screenshot and then click save.



    enter image description here






    share|improve this answer













    Try this,



    1) Under Marketing-> URL rewrites search products.html under Request Path column. Then edit that and change the request path URL as products-old.html and then click save.



    2) Create the new URL rewrite as like below screenshot and then click save.



    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 7 '16 at 9:08









    saravanavelusaravanavelu

    3,00562144




    3,00562144













    • Nope it's not working for Me. It's adding that value but on frontend it's not redirecting

      – Ankit Shah
      Nov 7 '16 at 9:15











    • Did you tried reindex and clearing cache and generation folders?

      – saravanavelu
      Nov 7 '16 at 9:25











    • Yes i already tried

      – Ankit Shah
      Nov 7 '16 at 9:26



















    • Nope it's not working for Me. It's adding that value but on frontend it's not redirecting

      – Ankit Shah
      Nov 7 '16 at 9:15











    • Did you tried reindex and clearing cache and generation folders?

      – saravanavelu
      Nov 7 '16 at 9:25











    • Yes i already tried

      – Ankit Shah
      Nov 7 '16 at 9:26

















    Nope it's not working for Me. It's adding that value but on frontend it's not redirecting

    – Ankit Shah
    Nov 7 '16 at 9:15





    Nope it's not working for Me. It's adding that value but on frontend it's not redirecting

    – Ankit Shah
    Nov 7 '16 at 9:15













    Did you tried reindex and clearing cache and generation folders?

    – saravanavelu
    Nov 7 '16 at 9:25





    Did you tried reindex and clearing cache and generation folders?

    – saravanavelu
    Nov 7 '16 at 9:25













    Yes i already tried

    – Ankit Shah
    Nov 7 '16 at 9:26





    Yes i already tried

    – Ankit Shah
    Nov 7 '16 at 9:26













    0














    the trick to this is:




    1. Go to ROOT folder of magento 2

    2. Open .httaccess file


    3. Add following line (IMPORTANT!!! MAKE SURE TO ADD IT TO BEGINING
      OF THE FILE, FIRST LINE IS BEST, OTHERWISE IT WILL NOT WORK
      , Replace the first link with your category link and second the page you wish to redirect to):



      RewriteRule catalog/category/view/s/example/id/213/ https://example.com/example [L,R=301]



    Save and enter following commands in the command tool:



        php bin/magento indexer:reindex
    php bin/magento cache:clean
    php bin/magento cache:flush


    I was fighting with this, but all this time the trick was to add the line at the beggining of the .htaccess file. I was adding it at the end (last line)






    share|improve this answer




























      0














      the trick to this is:




      1. Go to ROOT folder of magento 2

      2. Open .httaccess file


      3. Add following line (IMPORTANT!!! MAKE SURE TO ADD IT TO BEGINING
        OF THE FILE, FIRST LINE IS BEST, OTHERWISE IT WILL NOT WORK
        , Replace the first link with your category link and second the page you wish to redirect to):



        RewriteRule catalog/category/view/s/example/id/213/ https://example.com/example [L,R=301]



      Save and enter following commands in the command tool:



          php bin/magento indexer:reindex
      php bin/magento cache:clean
      php bin/magento cache:flush


      I was fighting with this, but all this time the trick was to add the line at the beggining of the .htaccess file. I was adding it at the end (last line)






      share|improve this answer


























        0












        0








        0







        the trick to this is:




        1. Go to ROOT folder of magento 2

        2. Open .httaccess file


        3. Add following line (IMPORTANT!!! MAKE SURE TO ADD IT TO BEGINING
          OF THE FILE, FIRST LINE IS BEST, OTHERWISE IT WILL NOT WORK
          , Replace the first link with your category link and second the page you wish to redirect to):



          RewriteRule catalog/category/view/s/example/id/213/ https://example.com/example [L,R=301]



        Save and enter following commands in the command tool:



            php bin/magento indexer:reindex
        php bin/magento cache:clean
        php bin/magento cache:flush


        I was fighting with this, but all this time the trick was to add the line at the beggining of the .htaccess file. I was adding it at the end (last line)






        share|improve this answer













        the trick to this is:




        1. Go to ROOT folder of magento 2

        2. Open .httaccess file


        3. Add following line (IMPORTANT!!! MAKE SURE TO ADD IT TO BEGINING
          OF THE FILE, FIRST LINE IS BEST, OTHERWISE IT WILL NOT WORK
          , Replace the first link with your category link and second the page you wish to redirect to):



          RewriteRule catalog/category/view/s/example/id/213/ https://example.com/example [L,R=301]



        Save and enter following commands in the command tool:



            php bin/magento indexer:reindex
        php bin/magento cache:clean
        php bin/magento cache:flush


        I was fighting with this, but all this time the trick was to add the line at the beggining of the .htaccess file. I was adding it at the end (last line)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 20 at 21:45









        Denis AliDenis Ali

        13




        13






























            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%2f144437%2fmagento-2-redirect-from-category-page-to-cms-page%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

            An IMO inspired problem

            Management

            Has there ever been an instance of an active nuclear power plant within or near a war zone?