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\...


4

The problem is that the synthax is not the same when there is variable in URL. Please try RewriteCond %{QUERY_STRING} ^format=ATOM$ RewriteRule ^Blog/post/feed/2013/06/20/NASA-Gets-In-On-the-Search-and-Rescue-Game-to-Further-Space-Exploration$ http://www.actuatorzone.com/blog? [L,R=301]


4

The first thing I noticed was that the search returns an 301 redirect with the HTTP header Content-Type: text/html; charset=iso-8859-1 and the wrong URL http://caserisimo.mx/catalogsearch/result?q=br%25C3%25B3coli. Your search result page has the correct UTF-8 content type. I guess you want to find out where that redirect is coming from.


4

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


3

I fixed it - in my case a GEO Location extension was responsible for the issue. Anyway - to check in general I recommend to take a look in .htaccess index.php search for keywords like "controller_action_predispatch" events, "header('Location:" or ""HTTP_X_FORWARDED_FOR" to identify related extensions and disable these.


3

You can have it easier than a rewrite! Just set the homepage to a url you want. System > Config > General > Web > Default Pages > Default Web Url There you can fill in whatever you want, e.g. a category: catalog/category/view/id/7 or a product page: catalog/product/view/id/7 or a cms page This is only an internal redirect and the customer ...


3

I had the same issue with the CREARESEO extension. I fixed it by doing the following: Open /app/code/community/Creare/CreareSeoCore/Model/Observer.php Find: public function forceProductCanonical(Varien_Event_Observer $observer) { if (Mage::getStoreConfig('catalog/seo/product_canonical_tag') && !Mage::getStoreConfig('product_use_categories'...


3

In your class declare the variable /** * @var \Magento\Framework\App\ResponseInterface */ protected $_response; In constructor initialize the object public function __construct ( \Magento\Framework\App\ResponseInterface $response ){ $this->_response = $response; } Finally add the url to 301 redirects like ...


2

As per our discussion in the IRC, use webserver redirects. Your goal is to redirect old urls to new urls. This is the job of the webserver, not the application. Otherwise you are loading the application twice for each of these requests.


2

In this case,you can use event/observer and on event controller_front_init_before fire an observer. First i guess that your old product id and new product id are same. On that observer check query string($_SERVER['QUERY_STRING']) content ?product_id=productID pattern in url then basic of this redirect to current system product url. Example: Suppose, ...


2

You can try the following: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/admin RewriteCond %{REQUEST_URI} !^admin RewriteCond %{REQUEST_URI} !^/index.php/admin RewriteCond %{REQUEST_URI} !^index.php/admin RewriteRule (.*) http://www.b.co/$1 [R=301,L] You can change admin if you use another path for your admin area.


2

Try appending [R=301] to your RewriteRule entries. If you have existing parameters (like [L]), comma-separate them: [R=301,L].


2

1) Copy all file of site to new host 2) Database setting i. App/etc/local.xml -- Change setting here of new database in new server 3) Url Configuration: Open phpmyadmin find core_config_data table find web/unsecure/base_url and change to new URL find web/secure/base_url and change to new URL 4) Clear cache 5) Remove the php.ini file if there ...


2

I had a similar problem. Try this... Under System => Configuration, go under General, and select the Web tab. Change "Auto-redirect to Base URL" to No


2

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


2

Assuming category-name varies, then I don't see any way you can do this solely from 301 rewrites in a .htaccess file. You may need to redirect the old URLs to a custom-coded script that will then redirect to the appropriate new URL, based on some sort of logic that will connect the old product URL to the appropriate new category-name/product-url


2

htaccess is good Idea .But it is too tuff write code for 14k urls in a htaccess file, Better idea to rewrite using magento code and that case ,you can use 3rd party extensions like https://www.magentocommerce.com/magento-connect/optimise-web-s-mass-301-redirects-for-404-pages.html https://www.magentocommerce.com/magento-connect/smooth-move-seo-301-...


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

As of my knowledge, I have been facing similar issues. You can alternately use below steps. First step is, convert or redirect the 404 pages into catalog search results, So that your visitors get a page with products similar to the specific product they were looking for(You may implement or use few of the extension from marketplace for this functionality) ...


2

If you want to redirect from root script, you need to use this try { require_once __DIR__ . '/app/bootstrap.php'; } catch (\Exception $e) { echo 'Autoload error: ' . $e->getMessage(); exit(1); } $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); $objectManager = $bootstrap->getObjectManager(); $objectManager = \Magento\...


2

The issue was the Pound was only listening to 443 (https) and all HTTP was going straight to Varnish. Magento was supposed to be redirecting but sometimes Varnish would just send the HTTP version. The solution was to get Varnish itself to handle the http->https redirect. The way this was done is by editing the varnish vcl file as follows: sub vcl_recv { ...


1

There are a few ways: In the .htaccess or VirtualHost configuration of Apache or nginx A Router observer in Magento that maps a regex of particular patterns to rewrite to the new Magento location from your legacy application's URL Create records in the core_url_rewrite table


1

In your .htaccess the following should work: Redirect 301 /?htm/147 /someplace You could also look at using a rewrite match redirectMatch 301 ^/?htm/147/?$ /someplace/ If you're going from someplace.com to someplace.net you would need to setup the following: RewriteEngine on RewriteCond %{HTTP_HOST} ^someplace.com [NC,OR] RewriteCond %{HTTP_HOST} ^www....


1

It turns out the Redirect directive in an .htaccess file won't match against the query string, only the request uri (the part before the question mark). To match against the query string you'll need to use the RewriteCond and RewriteRule directives. More info on this here: https://simonecarletti.com/blog/2009/01/apache-query-string-redirects/ This should ...


1

RewriteCond %{QUERY_STRING} pId=11390&base=1 RewriteRule productdetail.php http://example.com/new-magento-url.html? [R=301,L] That should match the query string you want and perform the redirect. Place it above the last Magento rewriterule for index.php


1

You have to use RedirectMatch in order to redirect URLs with parameters. For Example: RedirectMatch 301 /shop.php?id=17299 /target-url.html Put them after RewriteEngine on, but before the first RewriteRule.


1

As @Aric Watson states: you cannot do this with plain .htaccess, because the category-name-slug will not be predictable from .htaccess. But... assuming you're only interested in creating 301's to the new URL's you don't actually need to know the new URL. A 301 to /catalog/product/view/id/[product id] would do as well, given that the canonical of your ...


1

The following changed the 302 to a 301 between http://www and https://www RewriteEngine On RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain ...


1

This version will allow you to still see the admin styles. RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/admin RewriteCond %{REQUEST_URI} !^admin RewriteCond %{REQUEST_URI} !^/skin RewriteCond %{REQUEST_URI} !^/js RewriteCond %{REQUEST_URI} !^/media RewriteCond %{REQUEST_URI} !^/index.php/admin RewriteCond %{REQUEST_URI} !^index.php/admin ...


1

Try this in your .htaccess: Options +FollowSymLinks RewriteEngine On RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$ # Match the sub domain (if there is one). RewriteCond %{HTTP_HOST} ^(.+\.)?example\.com$ [NC] # %1 is the sub domain (or empty). RewriteRule ^(.*)$ http://%1example.net/$1 [R=301,L]


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