Welcome to Centmin Mod Community
Register Now

How to stop 301 redirect

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by brijendrasial, Dec 22, 2020.

  1. brijendrasial

    brijendrasial Active Member

    207
    154
    43
    Mar 21, 2018
    Ratings:
    +236
    Local Time:
    10:36 PM
    1.13.9
    10.0.22-MariaDB
    One of my client is facing an unwanted domain redirecting to his domain. This is not a referrer its a 301 redirect. For example www.redirectdomain.com is redirecting to www.domain.com and I want to stop this redirect with an error. Is that possible somehow?

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:06 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Is this with Centmin Mod Nginx server?? 301s are more deliberate so they'd be in the Nginx vhost for the domain. Most Centmin Mod configured redirects I setup are 302 temp redirects so they aren't cached in web browsers permanently like 301 redirects.

    Check in incognito browser or command line header checks
    Code (Text):
    curl -I https://www.redirectdomain.com
    curl -I http://www.redirectdomain.com
    

    to see where location field is targeting if 301/302 status is seen

    both curl command line and incognito browser will not have any 301 cached redirects permanently stored like with normal web browser session. That's why you test with 302 first as 301 are permanently cached in your browser until you clear all site contents.
     
  3. brijendrasial

    brijendrasial Active Member

    207
    154
    43
    Mar 21, 2018
    Ratings:
    +236
    Local Time:
    10:36 PM
    1.13.9
    10.0.22-MariaDB
    My query was little different but there is no solution as such with nginx. I has to disavow the spam redirecting domain.
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:06 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Oh you mean a domain you don't control is redirecting to your domain. Yeah, can't really stop them AFAIK.
     
  5. buik

    buik “The best traveler is one without a camera.”

    2,026
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,674
    Local Time:
    6:06 PM
    Please contact the registrar (not registrant) of the spammy domain in question.
    When spam is redirected to your customer's domain, and you can prove it.
    The registrar should take action, and will often also take action.

    Spam cases are usually dealt harshly but justifiably.

    Unfortunately, I have to admit that it does depend on the top level domain.
    Don't know if the registrar of .hair (yes that exists :) ) act as strict as .com.
     
    Last edited: Dec 24, 2020