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.
731
questions
1
vote
1
answer
31
views
How to create a .well-know folder on Magento Cloud?
I want to create a mystore.com/.well-known folder on my Magento Cloud, where I can add many files that will be accessible via public URL.
How to do it?
0
votes
2
answers
37
views
Magento 2: Nginx Rewrite Rule for Updated Media Base URL
I recently updated my media base URL to {{unsecure_base_url}}media/version1234567/. While attempting to create a rewrite rule in Nginx, I've encountered some difficulties.
For a single URL, I used the ...
1
vote
1
answer
31
views
Magento 2 - How can I redirect user to PDP on click of product card without using anchor tag
I need to redirect user to PDP page from PLP page not just on click of image or product name, but on click of whole card.
As per w3 standards I can not write div within anchor otherwise I would have ...
0
votes
0
answers
28
views
Redirect to a specific store
I'm trying to redirect on a specific store based on geoip. I added this code on index.php on my root, but I can't understand why it doesn't work. I get "main.ERROR: The store that was requested ...
0
votes
4
answers
66
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/...
1
vote
0
answers
65
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
129
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/...
1
vote
1
answer
114
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
2
answers
217
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 ...
0
votes
1
answer
37
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
196
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
44
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
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
185
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 ...
0
votes
3
answers
826
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
1
answer
159
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
179
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
86
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
1
answer
86
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
<?...
0
votes
0
answers
42
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/...
3
votes
1
answer
121
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
1
vote
1
answer
49
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 ...
2
votes
2
answers
67
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
607
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-...
2
votes
3
answers
2k
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
3
answers
320
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?
0
votes
1
answer
114
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
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
1
answer
418
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
457
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
23
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 ...
2
votes
1
answer
703
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 ...
1
vote
0
answers
84
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
71
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 ...
0
votes
1
answer
422
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 ...
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-...
0
votes
0
answers
31
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
332
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 ...
0
votes
0
answers
208
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
1k
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.
1
vote
3
answers
1k
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 ...
0
votes
1
answer
607
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;
...
0
votes
1
answer
426
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 ...
0
votes
1
answer
234
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
53
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 ...
0
votes
1
answer
125
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 ...
0
votes
1
answer
502
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
763
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
54
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/...