Custom Redirection for Brand In Category PagesMagento2 - Layered Navigation on category with childrencategory url rewrite to cms page or other link Magento 2302 Redirects for a specific store viewMagento2: Search products using filterable AttributesRender Category View based on Products searchGenerate Adminhtml Controller url with get parameter in BlockMagento 2: toolbar url problems in custom module with custom routerCan't match Catalog Rules for CategoryHow to solve Front controller reached 100 router match iterations in magento2Magento 2.3 Can't view module's front end page output?

Is it possible to do 50 km distance without any previous training?

Why doesn't H₄O²⁺ exist?

Are the number of citations and number of published articles the most important criteria for a tenure promotion?

What's the point of deactivating Num Lock on login screens?

How to format long polynomial?

Horror movie about a virus at the prom; beginning and end are stylized as a cartoon

How to source a part of a file

Could an aircraft fly or hover using only jets of compressed air?

Roll the carpet

"You are your self first supporter", a more proper way to say it

Can I make popcorn with any corn?

DC-DC converter from low voltage at high current, to high voltage at low current

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

What typically incentivizes a professor to change jobs to a lower ranking university?

Rock identification in KY

Paid for article while in US on F-1 visa?

I'm flying to France today and my passport expires in less than 2 months

What defenses are there against being summoned by the Gate spell?

Convert two switches to a dual stack, and add outlet - possible here?

dbcc cleantable batch size explanation

Why does Kotter return in Welcome Back Kotter?

Client team has low performances and low technical skills: we always fix their work and now they stop collaborate with us. How to solve?

What is the word for reserving something for yourself before others do?

Can a vampire attack twice with their claws using multiattack?



Custom Redirection for Brand In Category Pages


Magento2 - Layered Navigation on category with childrencategory url rewrite to cms page or other link Magento 2302 Redirects for a specific store viewMagento2: Search products using filterable AttributesRender Category View based on Products searchGenerate Adminhtml Controller url with get parameter in BlockMagento 2: toolbar url problems in custom module with custom routerCan't match Catalog Rules for CategoryHow to solve Front controller reached 100 router match iterations in magento2Magento 2.3 Can't view module's front end page output?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to redirect some URLs with category and brand names to category listing pages with a filter of brand ids but also I want the URL to remain the same as earlier.



For example:




if my URL is men/amiri. I want the URL to fetch all the category(men) product alongside brand(amiri).




I am able to redirect the page to category Controller with the brand but my new page has a URL of category controller like




catalog/category/view/category_id/manufacturer/brand_id.




I want to create the functionality somewhat similar to category page but with a brand filter.



I have made the below changes in match method of Router.php in Url-rewrite:



public function match(RequestInterface $request)

$rewrite = $this->getRewrite(
$request->getPathInfo(),
$this->storeManager->getStore()->getId()
);

$identifier = trim($request->getPathInfo(), '/');

if($identifier==='testing')
$rewrite = new UrlRewrite();
$rewrite->setTargetPath("catalog/category/view/id/18");
$rewrite->setRequestPath("testing");
$rewrite->setRedirectType(0);
$rewrite->setEntityType("category");

//return $this->processRedirect($request, $rewrite);


if ($rewrite === null)
//No rewrite rule matching current URl found, continuing with
//processing of this URL.
return null;

if ($rewrite->getRedirectType())
//Rule requires the request to be redirected to another URL
//and cannot be processed further.
return $this->processRedirect($request, $rewrite);

//Rule provides actual URL that can be processed by a controller.
$request->setAlias(
UrlInterface::REWRITE_REQUEST_PATH_ALIAS,
$rewrite->getRequestPath()
);
$request->setPathInfo('/' . $rewrite->getTargetPath());
return $this->actionFactory->create(
MagentoFrameworkAppActionForward::class
);










share|improve this question






























    0















    I want to redirect some URLs with category and brand names to category listing pages with a filter of brand ids but also I want the URL to remain the same as earlier.



    For example:




    if my URL is men/amiri. I want the URL to fetch all the category(men) product alongside brand(amiri).




    I am able to redirect the page to category Controller with the brand but my new page has a URL of category controller like




    catalog/category/view/category_id/manufacturer/brand_id.




    I want to create the functionality somewhat similar to category page but with a brand filter.



    I have made the below changes in match method of Router.php in Url-rewrite:



    public function match(RequestInterface $request)

    $rewrite = $this->getRewrite(
    $request->getPathInfo(),
    $this->storeManager->getStore()->getId()
    );

    $identifier = trim($request->getPathInfo(), '/');

    if($identifier==='testing')
    $rewrite = new UrlRewrite();
    $rewrite->setTargetPath("catalog/category/view/id/18");
    $rewrite->setRequestPath("testing");
    $rewrite->setRedirectType(0);
    $rewrite->setEntityType("category");

    //return $this->processRedirect($request, $rewrite);


    if ($rewrite === null)
    //No rewrite rule matching current URl found, continuing with
    //processing of this URL.
    return null;

    if ($rewrite->getRedirectType())
    //Rule requires the request to be redirected to another URL
    //and cannot be processed further.
    return $this->processRedirect($request, $rewrite);

    //Rule provides actual URL that can be processed by a controller.
    $request->setAlias(
    UrlInterface::REWRITE_REQUEST_PATH_ALIAS,
    $rewrite->getRequestPath()
    );
    $request->setPathInfo('/' . $rewrite->getTargetPath());
    return $this->actionFactory->create(
    MagentoFrameworkAppActionForward::class
    );










    share|improve this question


























      0












      0








      0


      1






      I want to redirect some URLs with category and brand names to category listing pages with a filter of brand ids but also I want the URL to remain the same as earlier.



      For example:




      if my URL is men/amiri. I want the URL to fetch all the category(men) product alongside brand(amiri).




      I am able to redirect the page to category Controller with the brand but my new page has a URL of category controller like




      catalog/category/view/category_id/manufacturer/brand_id.




      I want to create the functionality somewhat similar to category page but with a brand filter.



      I have made the below changes in match method of Router.php in Url-rewrite:



      public function match(RequestInterface $request)

      $rewrite = $this->getRewrite(
      $request->getPathInfo(),
      $this->storeManager->getStore()->getId()
      );

      $identifier = trim($request->getPathInfo(), '/');

      if($identifier==='testing')
      $rewrite = new UrlRewrite();
      $rewrite->setTargetPath("catalog/category/view/id/18");
      $rewrite->setRequestPath("testing");
      $rewrite->setRedirectType(0);
      $rewrite->setEntityType("category");

      //return $this->processRedirect($request, $rewrite);


      if ($rewrite === null)
      //No rewrite rule matching current URl found, continuing with
      //processing of this URL.
      return null;

      if ($rewrite->getRedirectType())
      //Rule requires the request to be redirected to another URL
      //and cannot be processed further.
      return $this->processRedirect($request, $rewrite);

      //Rule provides actual URL that can be processed by a controller.
      $request->setAlias(
      UrlInterface::REWRITE_REQUEST_PATH_ALIAS,
      $rewrite->getRequestPath()
      );
      $request->setPathInfo('/' . $rewrite->getTargetPath());
      return $this->actionFactory->create(
      MagentoFrameworkAppActionForward::class
      );










      share|improve this question
















      I want to redirect some URLs with category and brand names to category listing pages with a filter of brand ids but also I want the URL to remain the same as earlier.



      For example:




      if my URL is men/amiri. I want the URL to fetch all the category(men) product alongside brand(amiri).




      I am able to redirect the page to category Controller with the brand but my new page has a URL of category controller like




      catalog/category/view/category_id/manufacturer/brand_id.




      I want to create the functionality somewhat similar to category page but with a brand filter.



      I have made the below changes in match method of Router.php in Url-rewrite:



      public function match(RequestInterface $request)

      $rewrite = $this->getRewrite(
      $request->getPathInfo(),
      $this->storeManager->getStore()->getId()
      );

      $identifier = trim($request->getPathInfo(), '/');

      if($identifier==='testing')
      $rewrite = new UrlRewrite();
      $rewrite->setTargetPath("catalog/category/view/id/18");
      $rewrite->setRequestPath("testing");
      $rewrite->setRedirectType(0);
      $rewrite->setEntityType("category");

      //return $this->processRedirect($request, $rewrite);


      if ($rewrite === null)
      //No rewrite rule matching current URl found, continuing with
      //processing of this URL.
      return null;

      if ($rewrite->getRedirectType())
      //Rule requires the request to be redirected to another URL
      //and cannot be processed further.
      return $this->processRedirect($request, $rewrite);

      //Rule provides actual URL that can be processed by a controller.
      $request->setAlias(
      UrlInterface::REWRITE_REQUEST_PATH_ALIAS,
      $rewrite->getRequestPath()
      );
      $request->setPathInfo('/' . $rewrite->getTargetPath());
      return $this->actionFactory->create(
      MagentoFrameworkAppActionForward::class
      );







      magento2 redirection category-page






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 26 at 12:58









      Muhammad Hasham

      2,7612831




      2,7612831










      asked Mar 19 at 11:19









      Suraj singh RawatSuraj singh Rawat

      11




      11




















          0






          active

          oldest

          votes












          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%2f266513%2fcustom-redirection-for-brand-in-category-pages%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          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%2f266513%2fcustom-redirection-for-brand-in-category-pages%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

          Identifying “long and narrow” polygons in with PostGISlength and width of polygonWhy postgis st_overlaps reports Qgis' “avoid intersections” generated polygon as overlapping with others?Adjusting polygons to boundary and filling holesDrawing polygons with fixed area?How to remove spikes in Polygons with PostGISDeleting sliver polygons after difference operation in QGIS?Snapping boundaries in PostGISSplit polygon into parts adding attributes based on underlying polygon in QGISSplitting overlap between polygons and assign to nearest polygon using PostGIS?Expanding polygons and clipping at midpoint?Removing Intersection of Buffers in Same Layers

          Masuk log Menu navigasi

          อาณาจักร (ชีววิทยา) ดูเพิ่ม อ้างอิง รายการเลือกการนำทาง10.1086/39456810.5962/bhl.title.447410.1126/science.163.3863.150576276010.1007/BF01796092408502"Phylogenetic structure of the prokaryotic domain: the primary kingdoms"10.1073/pnas.74.11.5088432104270744"Towards a natural system of organisms: proposal for the domains Archaea, Bacteria, and Eucarya"1990PNAS...87.4576W10.1073/pnas.87.12.4576541592112744PubMedJump the queueexpand by handPubMedJump the queueexpand by handPubMedJump the queueexpand by hand"A revised six-kingdom system of life"10.1111/j.1469-185X.1998.tb00030.x9809012"Only six kingdoms of life"10.1098/rspb.2004.2705169172415306349"Kingdoms Protozoa and Chromista and the eozoan root of the eukaryotic tree"10.1098/rsbl.2009.0948288006020031978เพิ่มข้อมูล