Questions tagged [redirect]

Questions about HTTP redirects (status codes 301, 302, 303): How to set them up, why they are happening etc. For the catalog URL rewrite management in the admin panel, use the "url-rewrite" tag.

Filter by
Sorted by
Tagged with
0 votes
1 answer
5 views

How to use Klaviyo with PWA Studio?

I did the Klaviyo module setup in my Magento PWA Studio, it gave me all the backend functions, but I was missing the frontend JS scripts, I had to add them via Google Tag Manager. https://developers....
0 votes
1 answer
20 views

Observer redirect to admin controller not working in https

here is the code: events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:...
  • 2,151
1 vote
1 answer
39 views

307 redirect in Magento 2

How could I implement in Magento 2 a http 307 redirect. I would like if possible use Magento methods/framework not phps. Thank you.
  • 25
1 vote
1 answer
29 views

How to created a admin module to redirect to specific controller when admin user login

app/code/Vendor/Redirect/ ├── Controller │ └── Adminhtml │ └── Login │ └── Redirect.php ├── etc │ └── adminhtml │ └── routes.xml └── registration.php registration.php <?...
  • 2,151
0 votes
0 answers
21 views

Redirect to login page with exception

I using the following code to redirect all visitors to the login page. Everything is working fine with the exception of the Forgotten Password link... how would be make an exception for that /customer/...
  • 111
0 votes
0 answers
14 views

Why magento generates two 301 redirections after product name change

I have a problem with 301 in magento 2.4.2. When I change the name of product, magento generates pernament URL redirects. Two of them, have you guys have any ideas why this is happening?
0 votes
0 answers
26 views

Magento 2.4 Commerce Cloud redirects

Does anyone know how to redirect in the cloud from https://example.org/index.php and https://example.org/home to https://example.org (in routes.yaml)? I can reach my home page by calling all those ...
2 votes
1 answer
74 views

Magento 1 How to redirect on current page

I want to redirect to the current page and display a success message but it's redirecting to the home page. Any solution is available? Thank you
0 votes
1 answer
24 views

Load magento via .htaccess RewriteRule

I've a very specific problem with magento. At first let me explain what the problem is. I load magento into an iFrame to integrate the store into a webpage. This works like charm until it comes to ...
1 vote
2 answers
28 views

Weird 301 redirect for the entire site

I've made a copy of a Magento folder to set up another domain, swapped the old domain name both in the database (web secure url) and in the filesystem (env.php), and pretty much everywhere I could ...
0 votes
2 answers
130 views

Magento 2 How create front controller with a specific path?

I want create controller for specific path, but i can't know how i can do this. My controller must work with path like: site.com/usa/some-review/dynamicParam My path for controller: site.com/some-...
1 vote
2 answers
545 views

Magento 2 - Redirect base url to base url with store code

In Magento 2 I have two stores with "add store code in url" option enable. Store code 1 = "fr" Store code 2 = "es" I want to automatically add default store code in url: ...
  • 137
0 votes
0 answers
71 views

Stop redirect on session to store view

When I log in as customer on store view B, then visit store view A, most links I click on store view A result in a redirect to store view B. It only changes the domain name, not the URI using a 302. ...
0 votes
3 answers
147 views

Magento 2 - How to redirect customer to specific URL after login with loginById?

I need to redirect the customer to a certain URL from a observer after I log him in with loginById. How can I redirect?
  • 2,903
0 votes
0 answers
37 views

Have a plugin (interceptor) run once per session

So, I have this plugin for our project (drop-shipping marketplace), which redirects vendors without signed contracts to the contract signing page. The thing is, as it is, it infinitely redirects ...
0 votes
1 answer
30 views

how to solve temporary redirect in magento 2.4.3

I am the owner of the jewelry site when I run a Site audit from Semrush I get 944 temporary redirects, and I do not know how to solve temporary redirects in Magento 2.4.3 Please help
1 vote
1 answer
1k views

Magento 2: Multi-website redirects to main domain

I have a multistore in Magento 2. The main website URL is mainwebsite.ca. The second store runs through a subdirectory 'secondwebsite' and is accessed through the URL: mainwebsite.ca/secondwebsite/. I ...
  • 330
0 votes
0 answers
120 views

Magento 2 URL redirect Duplicate Content

I have a website with one store and several store views on Nginx (Magento Commerce Cloud). I am using store codes in the URL. Unfortunately, when the pages are called without store code in the URL, it ...
0 votes
0 answers
90 views

Err_too_many_redirects when setting session storage to redis

I'm trying to use redis as session storage on Magento 2.3.3. In my app/etc/env.php file I have: 'session' => [ 'save' => 'redis', 'redis' => [ 'host' => '127.0.0.1', 'port' =&...
0 votes
1 answer
140 views

Magento 2 all product and category request is redirect to http://baseurl/20us%20search%20us%20search%20us%20search?amnoroute

I have set up my live project in a docker environment using this. https://github.com/bhaveshpp/magento-docker-server/ All thing working perfect but when I search for the product it will redirect my ...
0 votes
1 answer
119 views

Get Page Type Of Referer Url In Magento 2

I am using Magento 2.3.5-p2 I am trying to get the page type for previous link I am able to get the previous link using \Magento\Framework\App\Response\RedirectInterface $redirect, public function ...
0 votes
1 answer
19 views

M2 - redirect only links coming from Google

We have a new webshop that already has some good indexed links in Google. But the links (from an old Magento) contain a .html extension. So I wanted to redirect them all to the non .html URL (using ...
  • 623
0 votes
1 answer
176 views

Magento 2 - New storeview redirects back to default store view - status code 302

I created a new storeview accessible under the URL app.example.com I added this to the .htaccess to set the MAGE_RUN_CODE Environment Variable to app if the URL app.example.com is called: SetEnv ...
  • 2,903
1 vote
0 answers
71 views

Ajax popup redirects to home page after clicking on "add to cart"

When the add to cart button is clicked, the page is redirected to the home page, and I would like to stay on the current page. I have tried different ways but couldn't accomplish it or getting an ...
0 votes
1 answer
41 views

magento2.4 customer login

My Magento 2.4 Customer login redirects to customer login again and not login. also my list page doesn't show any product I Use all commands like reindex but not show and I need to solve these two ...
  • 741
0 votes
1 answer
284 views

Magento 2 Check if error then redirect to custom url

I am using create post plugin. But the issue with this is, I want to redirect it to a custom URL if an error occurred in createPost() default to execute the function. For example, if a customer with ...
  • 41
0 votes
1 answer
762 views

Magento 2: How to use redirect in Router.php

I am trying to redirect a cms page to a custom controller. in router.php I can check the current URL, If the current URL is as an example if it matches /test-url i want to do a redirect to /test-url-...
  • 47
0 votes
0 answers
26 views

Can you do custom routing for cms page?

Can you change the url from cms page to a custom url? Is that something we could do with routes and show the cms page content
0 votes
1 answer
137 views

How to stop user login in Magento 2?

I want to stop user login in Magento 2 for some customers. So I created a back-end setting for customers to be blocked by the website and successfully get it done. But on the front end part, it is not ...
  • 586
0 votes
0 answers
102 views

Magento website not accessible in browser via VPN (Apache logs shows http 302 status)

I have deployed the magento website using bitnami magento stack on Azure platform. Also for security I have included this in VPN and connect to the server(SSH) via VPN client. Even after all magento ...
0 votes
1 answer
490 views

How to redirect Product Detail page to Home Page or 404 in Magento 2?

How to redirect Product Detail Page to 404 or Home Page in Magento 2.4. I don't want user to see product detail page in my store. Any help is appreciated. Thanks.
  • 586
0 votes
3 answers
508 views

Magento 2 - How to add redirect link to login link?

I created a new CMS site newsletter-abo and placed a text on it which shows this: Please login to access this site. The word "login" points to /customer/account/login. If the customer ...
  • 2,903
0 votes
1 answer
308 views

Magento 2: Redirect with Data in Observer

I have this code to redirect to custom page from observer. But I wonder how to redirect from observer, and with data transfer to the redirected page. <?php namespace Namespace\Module\Observer; ...
  • 1,228
0 votes
1 answer
314 views

Redirect 302 into 301

in our magento application we have somehow a 302 redirect from /customer/account into /connexion. I would like to change it into a 301 one. No idea how to process this. This seems to be handled in a ...
  • 1,024
0 votes
1 answer
165 views

I have newly installed magento 2.4.1 in my localhost(ubuntu), but the problem is that I cannot see the URL admin panel login screen

My general customer view frontend is working fine. But when I tried to login into the admin area , then I enter this in address of chrome web browser - http://127.0.0.1/local_m241/lcl_m241/index....
1 vote
0 answers
45 views

Redirect root page to specific store (language) view

We setup a Magento 2 Shop with 3 languages: Www.domain.com/de_ch/ Www.domain.com/fr_ch/ Www.domain.com/en_ch/ Where de_ch is the default language. The problem now is, that we get duplicate content for ...
  • 11
0 votes
1 answer
55 views

Magento 2 custom dashboard Page

I want to show a completely custom dashboard. I have a controller for that. I just want to show this page when Admin login. I don't want to show the default Magento dashboard controller I want my ...
  • 816
0 votes
1 answer
319 views

Magento 2 how to redirect to checkout on ajax submit?

I'm trying to redirect a form to checkout after clicking ajax submit request. I'm able to reach the controller, but I can't redirect to checkout. Here is my code: public function execute(){ $...
0 votes
1 answer
350 views

Redirect to login page triggering even after customer logs in

I have a CMS page with content that can only be seen by logged in users. I have an if statement that checks $this->_sessionFactory->create()->isLoggedIn(); and if they're not logged in, this ...
0 votes
1 answer
45 views

I found this file /vendor/magento/module-customer/Controller/Account/LoginPost.php file is having some code. What is the explanation of below code?

I want to know what actually these two lines of code are doing. $redirectUrl = $this->accountRedirect->getRedirectCookie(); if (!$this->getScopeConfig()->getValue('customer/...
0 votes
1 answer
114 views

Suppose I reach to this page customer/account/login/, after I click on "Sign In" button and i found referer feature not working :(

How to echo or print the referer url(history page) from where I reached to that login page. I have to implement something that after login user should not reach to dashboard instead he should re-...
2 votes
1 answer
196 views

What does resultRedirectFactory?

I found a code at /vendor/magento/module-customer/Controller/Account/Login.php /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); I want to know ...
0 votes
1 answer
296 views

Error redirected you too many times upon trying to install Magento 2.4

I just downloaded latest version of Magento 2.4 and I am trying to install it on Namecheap hosting but upon entering the URL of my website in the browser to start the setup wizard, it keep re-loading. ...
0 votes
2 answers
94 views

Mirror my Magento 2 website on one domain

Here is one request on me for a Magento 2 website. The boss here wants to make the following. He have a Magento 2 web store with 3500 products and lot of orders per day. Cause sometimes the website is ...
0 votes
1 answer
49 views

Get target url in layout before observer

I'm inside an observer <event name="layout_load_before"> <observer name="add_robot" instance="FranceTombale\Robot\Observer\NoindexfollowOnProduct" /> </...
  • 1,024
0 votes
2 answers
145 views

How to redirect domain.com to www.domain.com?

I have this code in .htaccess Options +SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] But it still appears ...
  • 1
0 votes
1 answer
552 views

Magento 2 redirect back with message from controller, redirecting working fine but error message not showing

Messages do not appear after redirection. Tried many solutions but no luck. Here is the code I tried. I have created a fronted form with custom routing with URL params. public function execute(){ ...
0 votes
0 answers
73 views

Redirect url with key formula in Magento 2

I'm trying to do this in Magento 2: I have my url : https://www.example.com/page/ I'd like to add after /page a key value. Example : /page/key1, /page/key2 ... Then I get the key value with $this->...
0 votes
1 answer
139 views

How to add 301 Redirect pages in magento 2?

I want to add 301 redirects to these URLs - 1-> From www.abc.com/blog To www.abc.com/blog/ 2-> From www.abc.com/contact To www.abc.com/contact/ 3-> From www.abc.com/catalogsearch/advanced To ...
0 votes
1 answer
116 views

Magento 2 If associated product qty are out stock, so configurable how to disable?

We were using Magento 2.3.5 version. Question: associated product qty are out of stock, so configurable product how to disable or redirect 302 pages? Thanks in advanced.

1
2 3 4 5
15