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

          Masuk log Menu navigasi

          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

          Старые Смолеговицы Содержание История | География | Демография | Достопримечательности | Примечания | НавигацияHGЯOLHGЯOL41 206 832 01641 606 406 141Административно-территориальное деление Ленинградской области«Переписная оброчная книга Водской пятины 1500 года», С. 793«Карта Ингерманландии: Ивангорода, Яма, Копорья, Нотеборга», по материалам 1676 г.«Генеральная карта провинции Ингерманландии» Э. Белинга и А. Андерсина, 1704 г., составлена по материалам 1678 г.«Географический чертёж над Ижорскою землей со своими городами» Адриана Шонбека 1705 г.Новая и достоверная всей Ингерманландии ланткарта. Грав. А. Ростовцев. СПб., 1727 г.Топографическая карта Санкт-Петербургской губернии. 5-и верстка. Шуберт. 1834 г.Описание Санкт-Петербургской губернии по уездам и станамСпецкарта западной части России Ф. Ф. Шуберта. 1844 г.Алфавитный список селений по уездам и станам С.-Петербургской губернииСписки населённых мест Российской Империи, составленные и издаваемые центральным статистическим комитетом министерства внутренних дел. XXXVII. Санкт-Петербургская губерния. По состоянию на 1862 год. СПб. 1864. С. 203Материалы по статистике народного хозяйства в С.-Петербургской губернии. Вып. IX. Частновладельческое хозяйство в Ямбургском уезде. СПб, 1888, С. 146, С. 2, 7, 54Положение о гербе муниципального образования Курское сельское поселениеСправочник истории административно-территориального деления Ленинградской области.Топографическая карта Ленинградской области, квадрат О-35-23-В (Хотыницы), 1930 г.АрхивированоАдминистративно-территориальное деление Ленинградской области. — Л., 1933, С. 27, 198АрхивированоАдминистративно-экономический справочник по Ленинградской области. — Л., 1936, с. 219АрхивированоАдминистративно-территориальное деление Ленинградской области. — Л., 1966, с. 175АрхивированоАдминистративно-территориальное деление Ленинградской области. — Лениздат, 1973, С. 180АрхивированоАдминистративно-территориальное деление Ленинградской области. — Лениздат, 1990, ISBN 5-289-00612-5, С. 38АрхивированоАдминистративно-территориальное деление Ленинградской области. — СПб., 2007, с. 60АрхивированоКоряков Юрий База данных «Этно-языковой состав населённых пунктов России». Ленинградская область.Административно-территориальное деление Ленинградской области. — СПб, 1997, ISBN 5-86153-055-6, С. 41АрхивированоКультовый комплекс Старые Смолеговицы // Электронная энциклопедия ЭрмитажаПроблемы выявления, изучения и сохранения культовых комплексов с каменными крестами: по материалам работ 2016-2017 гг. в Ленинградской области