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;
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 thecategory(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
add a comment |
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 thecategory(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
add a comment |
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 thecategory(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
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 thecategory(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
magento2 redirection category-page
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
add a comment |
add a comment |
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
);
);
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%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
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%2f266513%2fcustom-redirection-for-brand-in-category-pages%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