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
2 answers
8k views

Magento 2, too many redirects. All browsers, frontend and backend

I've scoured through numerous threads on this subject and tried everything that was pertinent to my situation to no avail. I have SSL enabled. Everything was working fine until I edited one of the ...
2 votes
1 answer
2k views

Magento2 redirect to Product Details Page on add to cart

I have disabled the Ajax cart. When clicking on addtocart, it is redirected to a product page, correct I expect this to be like this. My problem is, All products have custom options. But the Home page ...
2 votes
2 answers
5k views

Magento 2 - redirect to final checkout page (checkout success/failed)

I have a custom payment module. When the user select this payment method at checkout, he is redirected to custom module controller, which redirects him to payment gateway. Then he fills his credit ...
1 vote
1 answer
1k views

Magento 1.9.1 - Unable to edit (click) URL Rewrite fields in backend

I'm trying to edit (or redirect) some category menus to other categories. Example, I have two sub-categories called "Compression Wear" (id 60 - /compression-wear.html) AND "Compression Wear" (id 67 - /...
0 votes
1 answer
1k 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-...
3 votes
2 answers
2k views

Redirect issue after add to cart in magento2 custom controller

I am calling my custom controller for adding the product through the form action. Below is my controller file. <?php namespace {Vendor}\{Module}\Controller\Product; use Magento\...
0 votes
1 answer
2k views

Rewrite rule for media images

we need to set rewrite rule for some images in Magento 2.2.5 using .htaccess rules or nginx conf Example 1 Request Path: https://www.example.com//media/catalog/product/cache/1/thumbnail/543x403/...
3 votes
2 answers
11k views

Magento 2 - Redirect user to specific page after register

I write an observer to observe the customer_register_success event and run the following codes to do the redirect but failed. Can anyone help? $url = $this->url->getUrl('/'); $observer->...
29 votes
8 answers
92k views

Redirect controller in magento 2

I added a new custom tab in customer dashboard. If my custom form is successfully executed i need to redirect to customer main page customer/account. How can I do this?
0 votes
1 answer
1k views

Redirect to Referrer URL after Login with Facebook/Google not working

Magento has a feature to redirect to the referrer page after a customer logs in. I have done this using the following code: $referer_url = $this->_redirect->getRefererUrl(); $...
2 votes
3 answers
1k 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: ...
0 votes
2 answers
1k views

Magento redirect to checkout after adding to cart

I want to disable the shopping cart page. I mean that when customers add products to cart, Magento will skip the shopping cart page and redirects them to the checkout page to shorten buying process. ...
1 vote
1 answer
2k views

How to prevent duplicate content issues caused by index.php in urls?

I've been trying to prevent our homepage from displaying as both www.domain.co.uk & www.domain.co.uk/index.php but now i've realised that every other page displays with /index.php in the url. ...
1 vote
1 answer
2k views

Form submit on same page

I want to submit my form on the same page : <form action="<?php echo Mage::helper('checkout/cart')->getAddUrl(Mage::registry('current_product')); ?>" method="post" id="...
4 votes
2 answers
3k views

How to send post data with redirect from magento 2 for a payment gateway?

we use magento2/app/code/Paymentgateway/Example/Controller/Standard/Redirect.php public function execute() { $order = $this->getOrder(); if ($order->getBillingAddress()) { $...
3 votes
1 answer
2k views

Modifying the redirect after editing a product in the cart

I have a problem modifying a redirect in magento CE 1.9.2. Let's say a customer has a configurable product in the cart, and would like to edit that product (ie. changing color or size or something). ...
0 votes
1 answer
2k views

Magento 2 controller redirect on button click in phtml file

I want to redirect customer using controller when button is clicked in one of my phtml files. So far I got, controller: public function execute(){ return $this->addToCart(); } public ...
0 votes
4 answers
61 views

Redirect link for multiple store

I have a small problem and don't know how to implement redirect based on selected language (as a multiple store views there are few languages: en, lt,lv). The file located in app/design/frontend/...
0 votes
2 answers
2k views

Magento 2 redirect going back to admin

I have a controller that is executed in the system configuration. The desired result is that the code is executed and is redirected back to its original page. When the url keys are active, the page ...
2 votes
3 answers
5k views

Magento 2 : Redirect on cart page after login

I want to redirect the customer to cart page after login from anywhere ex.login from checkout page or customer account login. Anyone know how to do this? Please help me.
0 votes
2 answers
4k views

Magento 2 change store view

I'm trying this script to detect browser language and redirect to Italian store view if the language is Italian or English store view if the language is not Italian. The country code is correctly ...
1 vote
2 answers
2k views

Magento 2: Can I response with a redirect on REST API?

I have an API endpoint that expects a GET request. On some scenarios, I want to be able to perform a redirect instead of responding with a result. e.g., If you'll open the API endpoint URL in a ...
1 vote
1 answer
2k 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 ...
0 votes
2 answers
290 views

Redirect to checkout from custom observer

I need to redirect to checkout from an observer related to the event customer_account_edited. Here is my code. I've deleted a lot of rows that actually works... Magento is doing everything well but ...
1 vote
0 answers
57 views

Running magento and varnish in kubernetes

Our M2 store is in development and we are in the process of adding Varnish enterprise. Magento is installed in its own namespace in Kubernetes called m2-dev and varnish is in another namespace called ...
4 votes
1 answer
97 views

Critical Error of : file_exists(): open_basedir restriction in effect.in my Magento 2?

Here I explained the issue in detail: : file_exists(): open_basedir restriction in effect. File(/autoload.php) is not within the allowed path(s): (/var/www/:/tmp/) in /var/www/mywebsite.com/...
8 votes
6 answers
16k views

Reasons for Magento redirecting to an install page

I have cloned a git repository containing a magento site in the same way as I normally do when joining a project. I went through the usual process of setting up database and setting everything up on ...
0 votes
2 answers
146 views

when logout Why i have to wait 5 second to redirect to homepage?

Would someone explain me for this feature please ? I do ask GPT , it say "It is designed to prevent potential security vulnerabilities, such as session fixation attacks." "This delay ...
1 vote
4 answers
3k views

Magento2 Event Observer Redirect Simple Product to Configurable Product

I'm trying to write a module to redirect simple products to their configurable products once each simple product is clicked on. I've done a bit research and wrote an Observer to catch event: ...
12 votes
9 answers
29k views

Magento2: redirection from Observer

We have already know that How to redirect from an Observer for magento 1.x version. but for magento 2,we does not know How to forcefully do redirection from an observer. I have done google ,but does ...
0 votes
0 answers
37 views

Endless redirect when gad and gclid are added to the url?

Magento 1.9 As soon as those 2 Google parameters are added to any product URL of my shop, I am getting the "this website does not redirect properly" error. I tried disabling all caches and ...
1 vote
1 answer
104 views

Do a 301 redirect if there is no products in the current category

As a part of the SEO optimizations, when a customer go to a category page and if there is no products in the category, can we redirect it to a 301? Eg: As a part of -ve testing, if we load the ...
0 votes
0 answers
11 views

URL from Google Shopping not redirecting properly?

Magento 1.4 I have a product with URL https://www.whatever.de/something.htm. This can be opened normally. Now, when a customer clicks on that product in Google Shopping, Google adds something to the ...
1 vote
0 answers
888 views

Magento2 weird checkout page issue on click of Proceed to Checkout button

Why does my checkout page navigate from checkout/cart to /checkout instead of checkout/onepage/success even though i have not done any modification to the Checkout module in magento 2 This issue ...
0 votes
1 answer
34 views

How to Add A link in the product page

I want a to add a link the customer can click which will redirect them to another page(a product) on the site. How can i achieve this? Ideally I'd like the link to be in the section where customer ...
0 votes
1 answer
137 views

A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later. Ajax call

I have a problem here. I use Ajax call to send data to controller. define([ 'jquery', 'Magento_Ui/js/form/components/button' ], function($, button){ 'use strict'; return button.extend(...
0 votes
1 answer
43 views

Redirect 404 Pages to HomePage

I am redirecting 404 pages to the homepage, but the URL is not changing it's the same 404 page URL I want to change it to the homepage. My code : <?php namespace Vendor\Module\App\Router; class ...
0 votes
0 answers
25 views

Redirect 404 Pages To the Homepage

We have disabled products, categories, and CMS. When we try to access the URL it redirects 404 page. I want to redirect 404 pages to the Homepage of the site.
0 votes
3 answers
646 views

Issue upgrading to Magento 2.4.6

I've recently upgraded my Magento version to 2.4.6. on my localhost. I installed it through Composer which indicates that everything has been successful. When I go to my local url, I get the browser ...
0 votes
0 answers
42 views

Really Weird Search Error

Elasticsearch 7, Magento 2.4.5 p1, running on a vps Centos7 WHM, test done with 3rd party search engines disabled. All caches cleared, and re-indexed. Also ran test with 3rd party search extension ...
0 votes
1 answer
160 views

Magento Store Redirect Geo IP Address

Acutually I am redirecting the customers to the Specifc Store based on their geo IP Addresses. I applied Plugin and Observer also but the same result. Everthing is fine working, But it cachees I have ...
11 votes
12 answers
41k views

Magento Redirects to Old Website regardless of what changes are made!

We are having the strangest Redirection problem on a Magento site. We copied the sites contents from another Magento site to a new URL. We have done this in the past with no problems but for some ...
0 votes
2 answers
1k views

Redirect category link with single product directly to the product page magento 2.1

I have 5 categories with single products each. I also have 5 stores. I want to redirect the user directly to the product page when he clicks on the category link in the main menu for each store. ...
0 votes
1 answer
108 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
148 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:...
1 vote
1 answer
80 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.
1 vote
2 answers
2k views

skip function execution using before plugin

I'm overriding the controller Magento\User\Controller\Adminhtml\User\Validate::execute() using before-plugin so I can perform some checks before magento validate using this function. If certain ...
1 vote
1 answer
67 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 <?...
3 votes
3 answers
709 views

Magento2 Migration Redirects to the old Server

I moved my magento2 installation to a new server with a new IP address. I used this documentation for my backups (http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-backup.html)...
0 votes
0 answers
35 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/...

1
2 3 4 5
15