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

Questions tagged [301-redirect]

Using HTTP 301 Redirect

Filter by
Sorted by
Tagged with
0 votes
1 answer
42 views

Best way to handle store switch redirects in Magento 2

Let's assume we have the following situation: 1 Magento website with 2 stores (EN - default, IT) and 1 product. A user is accessing the website and the default store view is loaded (EN). The user ...
0 votes
1 answer
22 views

http to https redirect

I've followed all the solutions found in similar issues in the forum. I have no succeed doing it. What i have: Magento 2.4.3 Varnish Cache 6 (set to work at port 80) Apache (set to work at port 8081 ...
0 votes
1 answer
2k views

Rewrite rule for media images

we need to set rewrite rule for some images in Magento 2.2.5 using .htaccess rules or nginx conf Example 1 Request Path: https://www.example.com//media/catalog/product/cache/1/thumbnail/543x403/...
1 vote
1 answer
2k views

How to prevent duplicate content issues caused by index.php in urls?

I've been trying to prevent our homepage from displaying as both www.domain.co.uk & www.domain.co.uk/index.php but now i've realised that every other page displays with /index.php in the url. ...
0 votes
1 answer
26 views

Magento 2: how to stop only redirect url for googlebot?

I have websites in .ca and .com. If someone hit .ca website from USA ip address it automatically redirects on .com and if it hits on .com website using CANADA ip address it automatically redirects on ....
0 votes
2 answers
292 views

Redirect to checkout from custom observer

I need to redirect to checkout from an observer related to the event customer_account_edited. Here is my code. I've deleted a lot of rows that actually works... Magento is doing everything well but ...
0 votes
1 answer
67 views

SEO URL rewrites content goes missing

I haven't really used the Marketing > SEO & Search: Url rewrites much over the past few years. It seems pretty straight forward but I can't figure out why it's blowing out the content of the ...
2 votes
2 answers
9k views

Magento 2.2.5: Admin login page redirect loop 301/302 after installing SSL and enabling HTTPS

Preconditions Ubuntu 18.04 DigitalOcean droplet Nginx 1.1.4 MariaDB 10.1.34 (MySQL 15.1) PHP 7.1 (Using FPM) Redis server 4.0.11 Steps to reproduce Download Magento 2.2.5 via Composer Install ...
0 votes
3 answers
1k views

ERR_TOO_MANY_REDIRECTS magento admin

After enable https, magento store works as expected but magento admin dashboard gives this error.
0 votes
1 answer
54 views

unable to save a rewrite

Im trying to save a new redirects into the urlrewrite model but it seems that save() doesn't exist in those factorys: Magento\UrlRewrite\Model\UrlRewriteFactory or Magento\UrlRewrite\Model\...
2 votes
2 answers
61 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 ...
2 votes
2 answers
572 views

Redirect if homepage

Im trying to make the Homepage invisible since im doing an integration between 2 sites and the non Magento site handles the Homepage already. So far I achieved this temporally with a JS redirect but ...
0 votes
1 answer
105 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
0 votes
1 answer
325 views

Proper way to remove .html extensions from URL and do a global redirect

I know how to remove.html extensions from URLs in Magneto 2.3, but I'm unsure what other steps I need to take to make sure I do everything properly. I found that I should also create a global redirect ...
0 votes
1 answer
571 views

How to rewrite url with query string in magento 2

I want to rewrite url like: https://www.test.com/custom-parent-cat/sub-cat/10-12-14-17-19.html?cat=101 to https://www.test.com/custom-parent-cat/sub-cat.html Please help me to achieve this. Thanks
3 votes
2 answers
893 views

Multiple URL Rewrites for the same product is SEO issue?

By default in Magento, while assigning categories to the product. The Magento itself creates a URL rewrites based on each category which all going to be redirected to same product page. Different ...
0 votes
1 answer
416 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
275 views

How to add 301 Redirect pages in magento 2?

I want to add 301 redirects to these URLs - 1-> From www.abc.com/blog To www.abc.com/blog/ 2-> From www.abc.com/contact To www.abc.com/contact/ 3-> From www.abc.com/catalogsearch/advanced To ...
0 votes
1 answer
998 views

301 Redirection on nginx server (thousands of 404 errors)

we have an issue with the website (using Magento, on nginx) as it has ~5k URLs returning a 404 error. Most of these are product pages. We need to make a 301 redirects for all these URLs, e.g.: ...
0 votes
3 answers
65 views

Redirects and SEO

We have a category that we make available for approximately 2 weeks every 2 months for a presale. Once the presale is finished I redirect the category to another using a custom redirect. What sort of ...
0 votes
0 answers
484 views

Magento2 How to redirect category url to external link?

I have a requirement wherein I need to redirect multiple categories to external site's respective category pages. For the same I have created categories in magento. Whenever we create a category in ...
0 votes
1 answer
908 views

Redirect rule when removing product from category

I am looking for help on a redirect rule for magento. I have recently removed a lot of discontinued products out of product categories for example: http://www.example.com/gym-wear-brands/golds-gym-...
0 votes
2 answers
322 views

URL rewrite SEO question - multi shop

I have a Multi webshop installation with 3 existing shops. They have their products. Now I want to migrate an OSCommerce shop to Magento and add as 4th shop. About 50% of the products are shared ...
0 votes
0 answers
113 views

Magento 1.9 - Varnish, nginx and redirects (http -> https and non-www to www)

trying to redirect all non-www traffic to www and all http traffic to https. Environment is Magento 1.9 with Varnish and nginx. We also have Cloudflare (fully SSL enabled). Using the code below in ...
0 votes
2 answers
788 views

Non http pages are redirecting to home page (Nginx)

I would like all my pages for http to redirect to the same location as https for example http://www.domain.com/somepage/ now redirects to https://www.domain.com I would like it to redirect to ...
0 votes
1 answer
3k views

Magento 2: URL Rewrite not working through .htaccess

I want to redirect some old URL's to new URL's I'm doing it in my .htaccess path: /root/.htaccess <IfModule mod_rewrite.c> ############################################ ## Enable rewrites ...
0 votes
3 answers
658 views

Moved from http to https but include www in url

Trying to setup my site so that its on HTTPS AND includes the WWW in the URL. After a while of searching I found a few posts that helped me redirect to https: stackoverflow.com/questions/25527671/...
0 votes
1 answer
700 views

Magento 2 : Old product url to new product url redirect

Create a few new products. And set a URL for it (test1, test2, test3, etc.) Change the URL via CSV import of that product (SKU, url_key) .. (change to 10test, 11test, 12test, etc) . When using the old ...
3 votes
2 answers
1k views

Magento: Delete products and 301 redirect to relevant it's parent category

Anyone have a solution for 301 permanent redirects for deleted products in Magento? I have a store with 5000 products. 4000 have been sold and will never be back in stock. I want to delete those ...
1 vote
1 answer
1k views

Nginx redirect for -only- homepage of old domain, to homepage of new domain

On the server.rewrites file within the nginx/ map, I have the following logic for redirecting the homepage of an old domain, to the homepage of a new domain: if ($http_host ~ ^(www\.)?olddomain.com ) ...
0 votes
1 answer
588 views

301 Redirect the Out of Stock Product Pages

Want to redirect for the products who are out of stock to custom url Had tried below url but it did not helped https://stackoverflow.com/questions/4824072/magento-out-of-stock-product-seo-problem
0 votes
2 answers
8k views

How can I programmatically perform a 301 redirect in Magento 2

Today I am trying to redirects 301 pro-grammatically. But I have problem from $this->_responseFactory->create()->setRedirect($CustomRedirectionUrl , 301)->sendResponse(); line. I have ...
1 vote
2 answers
2k views

301 Redirect Multiple Url using .htaccess Magento 2

I'm trying to 301 redirect multiple urls to new url. Using .htaccess File. What changes i have to make in .htaccess
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 ...
0 votes
0 answers
1k views

magento 2 how to redirect disabled product to category page?

I want to redirect disabled products to the related category page. I have tried discontinued option which is available in admin but it is not working. How can I fix the issue?
1 vote
0 answers
32 views

Setup automatic product redirect once out of stock on M1

Is there an extension/module for M1 Enterprise that will manage redirects to a suitable category page once a product is out of stock and won't come back into stock?
1 vote
1 answer
33 views

.htaccess redirect samplesitex.com to samplesitey/alias-page in both https and http variants

I am trying to redirect an alias url to a different url path. (it wont let me do this in cpanel for some reason) Example: SiteX.com > SiteY.com/this-page I have tried RewriteCond %{HTTP_HOST} ^...
1 vote
0 answers
54 views

Magento 2: To set 301 URL in Magento URL rewrites for this particular search

How to set 301 URL in Magento URL rewrites? From https://www.example.com/catalogsearch/result/?q=%7Bquery%7D To https://www.example.com/catalogsearch/result/?q=query I have tried with below ...
0 votes
1 answer
147 views

Rewrite Rules to revert URL structure?

I've got a site which at some point in the past used SEO friendly category pagination for example : category/subcategory/40.html category/subcategory/4.html category/subcategory/15.html category/...
0 votes
1 answer
2k views

Magento 2: Mass 301 Redirects for 404 Pages

I have a need in magento2 in Extension create like magento1 Mass / Bulk Redirects (301, 302, or any status) for Magento 404 Pages.
1 vote
1 answer
1k views

Domain redirection in htaccess not working

I have changed domain on the Magento store, however I need to still keep old domain urls accessible and redirected to new domain urls. for example. old-domain.com/products should redirect to new-...
2 votes
1 answer
1k views

Magento 2 with Varnish sometimes does not redirect HTTP to HTTPS

Our Magento 2 is setup with https on all pages (unsecure and secure, "use secure on frontend", etc.). However sometimes when I enter ourdomain.com it redirects (correctly) to https and sometimes it ...
1 vote
1 answer
452 views

Blocking RSS Brute Force 1.9

I noticed this weekend that someone was pounding on /rss/catalog/notifystock/ trying to brute force the admin credentials. I've added a line to the nginx vhost.d conf that returns 403 when you attempt ...
0 votes
1 answer
1k views

Product Redirect Loops

We have a Magento website (1.6.2) on a LEMP server which we have had running for just over 2 years. Recently we made a few changes; Changed the whole site to HTTPS. Created all new categories and got ...
0 votes
1 answer
162 views

If request path is already exist what should i do for redirecting url with 301?

How to rewrite URL with 301 redirecting if request path and id already exist. There is any other option to do that or can we do with .htaccess file?
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 ...
0 votes
1 answer
230 views

Http to https 301 redirect

I am trying to enforce https on an existing magento website, so far so good, the website gets always correctly redirected to the https URL configured in the backend. As of my understanding the ...
0 votes
1 answer
347 views

File not found. After adding 301 redirect - Magento 2

I've added a permanent 301 redirect to my Magento 2 store to remove .html from my category and product urls by adding the following code to my website .conf file - I'm using Apache redirectMatch 301 ...
0 votes
1 answer
598 views

301 redirect for multi website and store code added to url

I have a specific scenario to work with and need help. Currently I have set up for 8 years a Magento 1 multi website store with this configurations: Magento is installed in a subfolder of a domain ...
0 votes
1 answer
718 views

How to do redirect in Magento 2

I want to redirect to specific page. I have created one script for testing but its not working. I am unable to redirect to another website url. try { require_once __DIR__ . '/app/bootstrap.php'; ...