Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [redirect-url]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
9 votes
1 answer
2k views

Redirect to external url after order creation

I am making a payment gateway and I need to redirect from the invoice page to an external url. Basically when an order is created at Magento I create an order in a 3rd party app with curl, then I get ...
minus1's user avatar
  • 191
7 votes
3 answers
8k views

Magento 2: Maintenance Mode

I've configured Magento 2 website as maintenance mode from .maintenance.flag it's working, at the same time I have configured released IPs from .maintenance.ip file. For multiple IPs not working ...
Bojjaiah's user avatar
  • 3,762
7 votes
5 answers
13k views

Redirect from plugin Magento 2

I am trying to redirect to custom URL by using plugin feature of Magento 2 but somehow I am not able to redirect it. For this, I tried a couple of options like, Magento2: redirection from Observer ...
Keyur Shah's user avatar
  • 18.1k
7 votes
4 answers
8k views

Magento2: Re-direct to custom URL from observer

My requirement is that if a customer visits website from country India they should be redirected to indian website www.example.com/in/ . In all other cases it should be default website only. I'm ...
amitshree's user avatar
  • 7,036
5 votes
3 answers
30k views

Redirect to home page in Controller

I want to redirect my site to home page (base URL) in Controller. $this->_redirect(); Using above mentioned function gives me the warning to specify the argument. Warning: Missing argument 1 ...
Muhammad Saeed Khan's user avatar
5 votes
3 answers
3k views

Show product of a category in a custom page

I create a category with some product. Also create a custom layout for my page that I add new cms page with this layout that I created. I need to have this page with my layout because I want to add ...
Elham Gdz's user avatar
  • 605
4 votes
3 answers
694 views

What type of redirect is this?

While I'm studying a line of code in magento vendor file I found this code: $resultRedirect->setPath('*/*/'); What does this '*/*/' means and where does this redirects. Hope I will get more ...
Ramesh KR's user avatar
  • 876
4 votes
4 answers
4k views

Is it possible to redirect the Magento 2 Contact Form without a custom module?

I'm trying to get the Magento 2 Contact form to redirect not to /contact/index but someplace else. Here is what I have so far: We use a custom theme, in which I have created a the following folders ...
tecjam's user avatar
  • 4,033
4 votes
2 answers
5k views

Magento 2 : How to avoid 302 status code, actually Referrer URL returns 302 status code?

If anyone have idea please guide me, below is my code: <?php use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\Controller\...
Hitesh Balpande's user avatar
4 votes
1 answer
392 views

How to make Dynamic URL for Browser and Mobile Application - for Customer Confirmation mail URL?

Magento 2 gives us the ability to take more control of the customer account creation process. There is a special configuration setting located in Admin under Stores → Configuration → Customers → ...
Aditya Shah's user avatar
  • 7,617
4 votes
1 answer
893 views

How to use _redirect() method in Magento 2 model file

Magento\Framework\App\Action Redirect method is defined in Magento controller interface /** * @var \Magento\Framework\App\Response\RedirectInterface */ protected $_redirect; So i am aware about ...
Aditya Shah's user avatar
  • 7,617
3 votes
3 answers
6k views

Magento 2: Bulk 301 rewrite imports

Read this great reference for creating a csv for import but this was for Magento 1 and it states you only need store_id, id_path,request_path, target_path, options but these headers won't work for ...
babywit's user avatar
  • 659
3 votes
2 answers
985 views

Malware Attack On Magento 1.9.2

My website www.antiqworld.com whenever i am trying to open my website automatically redirect on (https://20.unverf.com/?h=230916016_ee5d07ec7ec_98__def_sub__sub_id_2&cnv=1) this url please help ...
Shahid Ali khan's user avatar
3 votes
2 answers
2k views

Magento 2 : How to redirect from a observer without exit or die (as it's not allowed by magento standards)

I know of a couple of ways of redirecting to a given URL in observer but all of them uses exit or die and they would not work without it. So, if someone knows of a way of doing it without using exit ...
Vivek Kumar's user avatar
  • 5,655
3 votes
1 answer
459 views

Magento 2 View cart from abandoned cart email auto redirect to cart after login

I want to redirect customers to cart page once they login to the site from the abandoned cart email. There is a way to set redirect after login is successful but i want redirect to happen only when ...
Siddhesh Shirodkar's user avatar
3 votes
0 answers
205 views

Magento2 custom referer URL redirects to correct URL but again redirects to My Account in few seconds

I have created a custom URL with referer like this: use Magento\Framework\UrlInterface; use Magento\Framework\View\Element\Template; public function __construct( Template\Context $context, ...
Narendra Vyas's user avatar
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\...
Jafar Pinjar's user avatar
  • 1,929
3 votes
0 answers
59 views

404 in home page when open incognito Magento 1.9

I have an issue that I got 404 page when open the store in incognito mode but for the regular page in the browser it works fine because it is already cashed before. Also when I tried to open any ...
Elghazoly's user avatar
2 votes
2 answers
329 views

Setting my base_url to Secure

Setting my base_url to HTTPS drops the query string I set the base URL for my site to https://www.example.com, now when user comes to my site from a non secure URL (link) that has a query at the end ...
Yehuda Schwartz's user avatar
2 votes
5 answers
3k views

How to remove index.php from url if we enter manually

How to remove index.php when we enter manually in the URL My store path is /var/www/html/testfolder/ Thanks
Raghu's user avatar
  • 1,710
2 votes
1 answer
841 views

Magento2: How to redirect to payment section checkout?

I am trying add code for redirect $this->resultRedirect->setPath('checkout/index/index#payment'); but some reason its take slash at the end of url so url become www.demo.com/checkout/index/...
Kul's user avatar
  • 1,787
2 votes
1 answer
2k views

Magento 2 checkout page redirection

I want to redirect the 'proceed to checkout' action in mini cart to a custom page. I can't set the new link in mini cart button. http://i.prntscr.com/ZGS7nessQsSMlbjZHSFj0Q.png
Jancy Abraham's user avatar
2 votes
1 answer
822 views

How can I prevent a redirect via custom controller?

I have a custom form with an action that calls my module controller, I would like to prevent the redirect and stay on the page where the form is submitted but when I try to add a wildcard in my ...
user1704524's user avatar
  • 2,483
2 votes
1 answer
289 views

Url redirection Help for magento 2

I need some help for url redirection in Magento 2. I want to show my own url in the address bar but the page should be from another url. For example, if the link is www.xyz.com/blog/post/post.html, ...
Charanjeet's user avatar
2 votes
1 answer
1k views

How Redirect to 3rd party payment gateway in Magento2?

In Magento 1 we define the getOrderPlaceRedirectUrl in the model which extends Mage_Payment_Model_Method_Abstract and redirect to a particular controller after checkout submit. Then from the ...
Magento2 Devloper's user avatar
2 votes
1 answer
2k views

How to redirect to specific category if product url is 404 due to product disabled in magento 2.3?

If I have disabled any product then it will redirect to 404. But I want to redirect that product url from 404 not found page to the category url in which this product is assigned. That means I want to ...
Vinod Kumar's user avatar
  • 2,065
2 votes
2 answers
352 views

Redirecting to different URL's after restoring the site on local

We have a development server to test our code changes before pushing them to live. Recently, we have restored the development server to local (xampp) for testing and also done the necessary changes to ...
Siva's user avatar
  • 1,120
2 votes
2 answers
499 views

Observer redirected too many times

I have set a pre-dispatch observer like this: \etc\frontend\events.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
simple guy's user avatar
  • 2,484
2 votes
1 answer
218 views

Need to redirect to given controller

I need to redirect to ('hello/Test/Customer') page but observer is not working. <?php namespace SimpleMagento\Custom\Observer; use Magento\Framework\Event\Observer; use Magento\Framework\Event\...
Akash Killedar's user avatar
2 votes
2 answers
1k views

magento 2.3 redirect all product urls without category path to urls with category path

I want to redirect all product URLs without a category path to their category path URLs for SEO purposes. Example - Redirect mywebsite.com/product-name.html to mywebsite.com/category1/sub-...
chanchal's user avatar
  • 417
2 votes
1 answer
50 views

Using getUrlPath in Magento 2.2.7 - URL Redirect

I have this script working on Magento 1.9 but can't figure out how to use it for Magento 2.2.7. <?php require_once 'app/Mage.php'; $sku = $_GET['sku']; $store = Mage::app()->getStore(); $path = ...
Snowman's user avatar
  • 23
2 votes
1 answer
362 views

Remove '.php' from url redirect [closed]

I have an URL like: base_url/cloths/mens.php now when we click on this above URL then it should redirect to: base_url/wp/cloths/mens/ here we want to remove .php extension from URL after ...
groy's user avatar
  • 351
2 votes
0 answers
212 views

Magento 1.9 rewrite/redirect issue

Magento is redirecting to the wrong url. Checked htaccess as I thought there is a problem but not, there is no redirect for this url. So I've checked rewrite table but there is no obvious cause. For ...
Rob D. A.'s user avatar
  • 867
2 votes
0 answers
434 views

Change redirect url based on store id

I create an observer for controller_action_predispatch in frontend to redirect site to particular store url like this: public function execute( \Magento\Framework\Event\Observer $observer ...
Hunter's user avatar
  • 1,484
2 votes
0 answers
105 views

Magento 1.7 redirecting URLs when URL rewrite table empty and non in htaccess?

Im just cleaning up my site and sorting out all the 404s in webmaster tools. To fix the 404s I was just putting in a manual 301 in the htaccess file like this. Redirect 301 /football-rebounders/spot-...
user3914769's user avatar
2 votes
0 answers
1k views

Magento + gclid + redirect is not working

I've just been on the phone with Adwords and they've told me my gclid url query string is not working properly. So I did some digging and found this stackexchange question / answer that really looks ...
loginid's user avatar
  • 394
1 vote
1 answer
10k views

Redirecting HTTP to HTTPS?

I've read into this quite a bit but can't seem to find a solution. I'm trying to set it so whenever someone visits a link for my site (and for whatever reason they don't include https it redirects to ...
AspiringProgrammer's user avatar
1 vote
1 answer
4k views

"Not Visible Individually" products display on Frontend in Magento2.4

Is there any way to display "Not Visible Individually" products on frontend? My goal is admin can see product before upload in site...
Himanshu's user avatar
  • 978
1 vote
2 answers
685 views

Magento 2 How to redirect to a custom block from a Controller

I have added a front phtml file followed by a Block, I need to redirect to that block from a controller. this is the Block path, it's working fine. http://mywebsite.co/schools/schoolzone_search/index/...
Praveen Negimani's user avatar
1 vote
1 answer
913 views

Magento 2.1.8 : Redirect to localhost for admin URL after update

After a update I can not login anymore to the admin backend. I had this issue several times after an update but until now could resolve it with the common tips (wipe static data, cleaup all caches, ...
Jan's user avatar
  • 31
1 vote
1 answer
49 views

how can i change all urls of old website

i just remove my website from hmsaver.com to homemarket.ae now every thing is working but i want to ask is that possible if any visitor came from google to hmsaver.com and he redirect with same url to ...
ALI's user avatar
  • 11
1 vote
2 answers
1k views

Redirection after login to another page is not working for server + Chrome issue

I have set previous URL like below in controller Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::helper('core/url')->getCurrentUrl()); After login, it will be redirect to ...
Ankita Panchal's user avatar
1 vote
1 answer
333 views

Get category url from custom category attribute

I have tried to redirect customer to a certain category after successful registration however I couldn't achieve it (even with the help in here, still didn't work stackexchange question)so I changed ...
zeusukdm's user avatar
  • 277
1 vote
1 answer
1k views

Wrong redirection of url [closed]

Magento redirecting the page url to the home page when i am clicking from outside. if you click here ,it will redirect to home page the link is http://whiteboardsnz.com/porcelain-whiteboards-3.html ...
Kishor's user avatar
  • 359
1 vote
1 answer
402 views

Sales order email sending concept

Magento with Desjardins payment gateway. I have noticed that my sales order email is sending well with other payment method but with Desjardins payment gateway its not. I worried bit and checked the ...
Charlie's user avatar
  • 3,136
1 vote
1 answer
147 views

$product->getProductUrl() returns URL without category prefix

I tried to enable the category prefix from admin STORES >> CONFIG >> CATALOG >> CATALOG >> SEARCH ENGINE OPTIMIZATION. It is working pretty well on the category page. I am ...
Charanjeet Singh's user avatar
1 vote
2 answers
2k views

Wrong url redirection for product or category page Magento 2.2.3

I am using magento 2.2.3 for my store.I observed that some of my product page url goes wrong url or 404 ex. if i am try to open this url: https://baseurl/good-tee-hoodie-1-lb then it open like ...
Balwant Singh's user avatar
1 vote
2 answers
743 views

URL Rewrite by custom router URL

I am using Magento version 2.2.6 I have already tried with Marketing >> URL Rewrite >> Add New URL Rewrite add custom URL, but it's not working when we use it with question mark in URL. It'...
Pradip Garchar's user avatar
1 vote
1 answer
945 views

Redirect 301 removing parameters in URL by .htaccess

In the file .htaccess in magento, I want to redirect a url with parameters. An example is this: https://example.com/presente/decoracao/teu-sorriso?PageSpeed=noscript I need to redirect this to the ...
Matheus Portela's user avatar
1 vote
1 answer
2k views

Magento 2 : Add to Cart Button redirect to contact page

I am using Magento 2, How to redirect to contact us page when adding a product to add to cart?
Md. Elias's user avatar