As of May 31, 2023, we have updated our Code of Conduct.

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
3 votes
1 answer
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->...
TFS's user avatar
  • 4,229
22 votes
7 answers
41k views

Redirect all http:// request to https://

Earlier i have posted this question : https://stackoverflow.com/questions/36104047/how-to-redirect-all-http-requests-to-https-on-magento but didn't get any reaction. Here is my site URL : www.trendy-...
Abhishek Kumbhani's user avatar
11 votes
8 answers
27k 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 ...
Amit Bera's user avatar
  • 76.7k
7 votes
3 answers
10k views

Onepage checkout: Already registered customer login redirects to create an account or login page

I have recently upgraded to 1.8.1 and am fairly new to magento. All other aspects of my site seems to be working just fine, however when a customer with an existing account adds item to the cart and ...
Dave's user avatar
  • 73
6 votes
2 answers
9k views

Redirect 'non www prefix to 'www' prefix still not working after disabling 'Auto-redirect to Base URL'

Magento install was redirecting all 'non-www' urls to the root home page. I found these questions on the same subject: Redirected to the Homepage when add www. in any URL Redirected to the Homepage ...
moobot's user avatar
  • 248
1 vote
2 answers
2k views

Magento 2 - How to Redirect Customer for Checkout After Login when cart is not empty

How to redirect customers to the checkout page after login when the cart is not empty for the customer? Loginpost\Redirect\etc\frontend\di.xml <?xml version="1.0"?> <config xmlns:...
ashanr's user avatar
  • 115
9 votes
7 answers
8k views

Website start redirecting to another url

Maybe it's infected by some virus. My website starts redirecting to these infected URL. http://mon.setsu.xyz and some time https://tiphainemollard.us/index/?1371499155545 Infected links what I did ...
inrsaurabh's user avatar
  • 1,656
28 votes
8 answers
86k 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?
Rajkumar .E's user avatar
  • 3,520
23 votes
7 answers
22k views

Magento 2 Custom Admin Action Redirected to Dashboard

I am taking the Magento 2 fundamentals development course and the Admin Router / Controller exercise seems out of date. The router does work, but the controller does not, it always just re-routes to ...
Kevin Chavez's user avatar
14 votes
1 answer
5k views

Automatic 301 redirects for disabled products

I'm trying to add automatic redirects for a custom Product Type (Event) in Magento 1.7. When an event date has passed, I am marking the product as disabled so users don't go to the wrong page, and I ...
kayluhb's user avatar
  • 243
11 votes
12 answers
40k 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 ...
JasonDavis's user avatar
  • 1,073
8 votes
3 answers
16k views

Disable redirect after product add to basket

When I add something from the category to the basket/cart it redirects me to the basket/cart. After searching I found that I could turn this functionality of in the admin system via Configuration &...
user9252's user avatar
  • 329
7 votes
4 answers
27k views

How to redirect a category to another link?

I have an extension in my store that I can upload posts with this and it has a link in the top menu that' name is blog. In the menu, I have a category that's name is News and I want to redirect it to ...
Elham Gdz's user avatar
  • 605
6 votes
2 answers
5k views

Redirect www to non-www keeping the path

In my .htaccess, the redirect from "www.example.com" to "example.com" works. But when the urls is "www.example.com/someotherpath.html" the redirect is still "example.com" How to solve this? I am ...
Bernhard Prange's user avatar
4 votes
3 answers
4k views

Magento 2 How to redirect customer to specific store view according to browser language?

How to redirect customer to specific store view according to browser language?
Ricky.C's user avatar
  • 2,164
4 votes
1 answer
3k views

Multiple Checkout Payment Gateway Redirection Issue

I am using the payment gateway InnovatePayments which is working fine for single checkout & redirected me to Payment Gateway page after clicking place order button where i entered credit card info ...
user3409089's user avatar
4 votes
3 answers
785 views

Bind subdomain to a Magento Controller

I am working on an application for which I want to create few sub-domains in system, which will be served by Magento application. One example scenario can be creating separate sub-domains for system ...
Lalit's user avatar
  • 319
3 votes
3 answers
9k views

Redirect customers to Home page/previous page after login/create account in magento 2 instead of Dashboard?

I am trying to redirect to user after login or creating account to either home page or previous page. My controller code is following it is not able to login or create an account. <?php /** * * ...
supriya mishra's user avatar
3 votes
0 answers
2k views

Magento 2: Same Event with Multiple Observer in Different Module causes redirection issue

Magento 2: Same Event with Multiple Observer in Different Module causes redirection issue To solve: Magento 2: Can we call one observer in another observer? I have followed below code magento\app\...
Jackson's user avatar
  • 9,749
2 votes
1 answer
2k views

Magento2.3.2: How to redirect customer to login page if not logged in before checkout?

How to redirect the customer to the signin/signup page if not logged in before proceeding to checkout?
Teja Bhagavan Kollepara's user avatar
2 votes
1 answer
6k views

Magento 2 : Redirect From Homepage to Login if not Logged

I would like to redirect customer from homepage to login page, if they are not logged in. I have a module however this just shows a blank homepage instead of redirecting. Repo: https://github.com/...
Ben H's user avatar
  • 153
1 vote
1 answer
2k views

Magento 2: Observer not redirecting to checkout page

I have below code of observer namespace Custom\Module\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\App\Request\DataPersistorInterface; use Magento\Framework\App\...
Jackson's user avatar
  • 9,749
1 vote
3 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: ...
Ethan Wan's user avatar
  • 163
9 votes
3 answers
7k views

Magento admin redirecting in loop

Magento Admin url keep on redirecting and shows the below error. This webpage has a redirect loop Frontend is working fine, but the problem is with the magento admin url. Also this problem occurs ...
vinothavn's user avatar
  • 1,339
9 votes
1 answer
9k views

Magento2 redirecting to Shopping cart

Is there a way in Magento2 to have the user get redirected to shopping cart page after clicking "add to cart" - instead of the mini cart option at top of page?
M21's user avatar
  • 353
8 votes
4 answers
3k views

How to redirect simple products to configurable product URL with options preselected in Magento 2.1

How can I redirect an SEO URL Key of a Simple product of which the visibility is set to "Not Individually Visible" to the parent Configurable Product SEO URL Key? There are two important ...
Chun-Yian Liew's user avatar
8 votes
5 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 ...
develophper's user avatar
  • 2,194
4 votes
2 answers
15k views

Multi store magento redirects to main store

I need to create create another store, I am following the instructions on the Wiki magento but I can not work. my problem is that when you enter the second store redirects me to the main store eg. ...
Alan Martins De Azevedo's user avatar
4 votes
1 answer
8k views

Magento 2: How to redirect to checkout page after product added to cart via Observer/Plugin from category page?

I have followed below & it works fine Magento 2 : Add to Cart Button redirect to contact page Only issue it should be redirected after product is added to cart. I have tried different methods ...
Jackson's user avatar
  • 9,749
4 votes
4 answers
8k views

Programmatically 301 Redirect

How can I programmatically perform a 301 redirect in Magento?
Steve Robbins's user avatar
3 votes
2 answers
3k views

Redirect customer login/register success to checkout Magento 2.2

I am creating a module for redirect login/register success to checkout if customer has some items on quote but that's not working. If I stop the event with that die; on Observer/Redirect.php above ...
Plim's user avatar
  • 133
3 votes
1 answer
229 views

Varien_Profiler and _redirect in Adminhtml

I want to profile a particular slow admin action that we have, but it calls _redirect at the end, is there an in-built way of seeing this profile information, or will I have to manually create an ...
Peter O'Callaghan's user avatar
3 votes
1 answer
875 views

Redirect From one category to another

This is driving me insane :( I need to redirect from one category to another existing category in Magento 1.9 I've tried to add a rewrite in magento's module but of course get the error Request Path ...
Andy Ellis's user avatar
3 votes
3 answers
28k views

Can I Delete The Thousands Of URL Rewrites?

I am wanting to add redirects from old site URL to new site URLs however when I go into URL Rewrite Management there are over 8,000 records there already. Can I delete these? Most of them are in the ...
emma's user avatar
  • 31
3 votes
2 answers
4k views

Magento Redirect to mobile website when on Smart Devices

so I have two websites example.com and example.com/mobile , when a user visits my site on a mobile device or tablets etc I would like for them to be redirected to the mobile.example.com. I have tried ...
SoulEater's user avatar
2 votes
2 answers
11k views

How to disable secure url for admin

I have installed ssl certificate , but https is still not working, so I would like to disable secure url for admin to work in backend. I have updated the mg_core_config_data table for the path secure ...
Nishanth Lawrence Reginold's user avatar
2 votes
2 answers
2k views

Redirected to the Homepage when add www. in any URL

For Example, I have one page: http://mensattire.co.uk/shirts If I add "www." in above url, means: www.mensattire.co.uk/shirts It redirects me to the homepage. Why ? My .htaccess file: #############...
A.M.'s user avatar
  • 23
1 vote
1 answer
2k views

magento 2.2.5 turn back to home when i change store view

i've an issue on magento 2.2.5. I've created two store view it/en, when I'm on product page and change store view from it to en and vice versa, I'm redirected to the home page. Someone can help me? ...
Antonio's user avatar
  • 83
1 vote
2 answers
4k views

all links redirecting to old domain after moving to new domain [duplicate]

we moved the site from one domain to another domain after moving, admin panel working fine. but in frontend, except the home page, every page/link is redirecting to the old domain. means categories ...
Baby in Magento's user avatar
1 vote
2 answers
979 views

Magento: How to redirect to a phtml page from a controller?

I have a controller and from there I want to redirect to a custom phtml file. My controller path is app/code/Softadroit/Prescription/Controller/index/Save.php The phtml file is stored in app/code/...
Arun Sharma's user avatar
  • 1,141
1 vote
2 answers
5k views

404 page url in magento 2

I am using Magento version 2.1.3 for my website. We are getting the correct 404 page while accessing the non-existing url. But I need to redirect the url to "/404" as well for the magento 404 page. ...
SOHO Prospecting's user avatar
1 vote
2 answers
12k views

Magento 2: how to redirect from an admin controller

In Magento 1, we were able to do the following directly in a controller action method : $this->_redirect('*/*/index'); Or in a more generic way: $this->_redirect('adminhtml/controller/action')...
Raphael at Digital Pianism's user avatar
1 vote
1 answer
4k views

Magento2: Redirecting to Cart page from Checkout page after Place Order

I added products to cart. Then did proceed to checkout. I have tried Cash on Delivery and Check / Money Order as Payment method. Everything is fine until the order review section. And then when I ...
Devidas's user avatar
  • 3,253
1 vote
1 answer
1k views

Installation Error - Redirect loop(Magento 1.9.0.1)

I had parked http: //example.com/ domain to a sub folder in my server lets say it "/magentofolder" I want to install magento inside /magentofolder. so far I did, 1)Unzipped magento installation file. ...
Arjun K R's user avatar
1 vote
2 answers
848 views

Forward Category Page to Product View Page not Working

I am trying to forward every category page to a product view page using an event observer. But it seems to be not working. Scenario : I am playing around with Magento router now. As part of this, I ...
Rajeev K Tomy's user avatar
1 vote
2 answers
8k views

Website is stuck in redirect loop

After changing Base URL to https & Base Link URL to {{secure_base_url}} in Admin > System > Configuration > Web > Unsecure, website is stuck in redirect loop ! This webpage has a ...
Pretendo's user avatar
  • 151
1 vote
2 answers
1k views

Redirect/rewrite home page domain.com to store view domain.com/en/

I have enabled Add Store Code to Urls to access the different store views of my Magento website, but now www.domain.com and www.domain.com/en/ have the same content. To avoid duplicate content I would ...
user2702370's user avatar
1 vote
1 answer
2k views

Magento 2 - Validate Items Prior to Placing an Ordeer

I have a requirement to validate each quote item before an order is placed. In our store, each product has a multi-select attribute called restricted_states. During checkout, once the customer ...
Joshua Barnes's user avatar
1 vote
0 answers
37 views

Magento Skip HTTPs redirect

I am using following code RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} !^/healthy-library # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not #...
magento2new's user avatar
1 vote
2 answers
502 views

Getting error " Type Error occurred when creating object "

When i edit in constructor file of my custom module it give me this error " Type Error occurred when creating object " i don't know what i am doing wrong i use same code for creating a Block ...
Prits's user avatar
  • 626