Category Archives: .htaccess

How To Write 301 or 302 Redirect Rules For Magento 2

I would like to know how can I write a 301 or 302 redirect rules for Magento 2

Method 1

For Magento 2, You can add 301 or 302 redirect rules from Magento 2 admin panel

1. Login your Magento 2 admin panel and click “Marketing” from main menu

2. Click Menu – URL Rewrites

3. Click button “Add URL Rewrite”

4. Select the “Redirect Type” ( 301 or 302 ) and fill the form

5. Save data and done

Method 2

Using .htaccess to create 301 or 302 redirect rules for Magento 2

Method 3

If your server has cPanel, you can use cPanel’s Redirects feature to add 301 or 302 redirect rules for Magento 2

Home >> Domains >> Redirects >> Add a redirect

How to Force HTTPS Using The .htaccess If Has Load Balancer

I have installed and enabled load balancer on my server, I would like to use htaccess to force HTTPS

You need use %{HTTP:X-Forwarded-Proto} to detect if its https or http

How To Block Bad Bots For Hostgator Via .htaccess

How to use .htaccess to block the bad bots for Hostgator server

First, you need to find out the keywords of user agents of bad bots and use RewriteRule to block any visitor which hold those keywords from their user agents.

e.g for bots – YandexBot and SiteExplorer

How Can I Make Magento Site Open With WWW

I have Magento store, but its open without “www”, How can I make Magento site open with www

You can update the url from backend

System > Configuration > Web > Unsecure > Base URL

Also to make sure visitor will be redirected to the URL with WWW when open the URL without WWW

you should include a piece of code within your .htaccess file

Above codes will make sure user will be redirected to domain with WWW

How To Redirect NON WWW To WWW Or WWW To NON WWW From Hosting24 Hosting

I am using Hosting24 Hosting, How can I redirect www url to without www url or without www url to with www url

Here are some methods can help you redirect non www url to www url or www url to non www url for your Hosting24 Hosting

.htaccess

non www to www

www to non www

PHP

www to non www

non www to www

cPanel

www to non www or non www to www

Home >> Domains >> Redirects >> Add a redirect

How To Redirect HTTPS To HTTP Or HTTP To HTTPS From Hosting24 Hosting

I am using Hosting24 Hosting, How can I redirect https to http url or http to https url

Here are some methods you can redirect https to http or http to https url for your Hosting24 Hosting

.htaccess

http to https

https to http

PHP

http to https

https to http

cPanel

http to https

Home >> Domains >> Redirects >> Add a redirect

How To Redirect NON WWW To WWW Or WWW To NON WWW From GoDaddy Hosting

I am using GoDaddy Hosting, I would like to know how to redirect www url to without www url or without www url to with www url

You can try following methods to redirect non www url to www url or www url to non www url for your GoDaddy Hosting

.htaccess

non www to www

www to non www

PHP

www to non www

non www to www

cPanel

www to non www or non www to www

Home >> Domains >> Redirects >> Add a redirect

<3>GoDaddy Account

non www to www

1. Login to your Godaddy Account

2. Click on “Launch” to expanding your all domain list

3. tick on that domain which you want to forward

4. Mouse hover on “Forward” button and click “Forwarding Domains”

5. “FORWARDING AND MAKING” popup will be appear and click “Add one now”

6. first select “http://” and then enter your site address with “www”. After that select “301 (Permanent)”, in FORWARD SETTINGS then selcet “Forward only”, then click on “ADD” button.

7. Finally hit on “SAVE” button to save your settings.

How To Redirect HTTPS To HTTP Or HTTP To HTTPS From GoDaddy Hosting

I am using GoDaddy Hosting, I would like to know how to redirect https to http url or http to https url

You can try following methods to redirect https to http or http to https url for your GoDaddy Hosting

Linux & cPanel

.htaccess

http to https

https to http

PHP

http to https

https to http

cPanel

http to https

Home >> Domains >> Redirects >> Add a redirect

Windows & Plesk

For Windows Server, we need to use web.config files to handle redirection.

http to https

https to http

How To Redirect NON WWW To WWW Or WWW To NON WWW From HostGator Hosting

I am using HostGator Hosting, I would like to know how to redirect www url to without www url or without www url to with www url

You can try following methods to redirect non www url to www url or www url to non www url for your HostGator Hosting

.htaccess

non www to www

www to non www

PHP

www to non www

non www to www

cPanel

www to non www or non www to www

Home >> Domains >> Redirects >> Add a redirect