Learn about Centmin Mod LEMP Stack today
Become a Member

How to stop 301 redirect

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

  1. brijendrasial

    brijendrasial Active Member

    139
    111
    43
    Mar 21, 2018
    Ratings:
    +170
    Local Time:
    4:31 AM
    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

    47,461
    10,759
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,715
    Local Time:
    9:01 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    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

    139
    111
    43
    Mar 21, 2018
    Ratings:
    +170
    Local Time:
    4:31 AM
    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

    47,461
    10,759
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,715
    Local Time:
    9:01 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    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.” Premium Member

    1,452
    394
    83
    Apr 29, 2016
    Flanders
    Ratings:
    +1,235
    Local Time:
    12:01 AM
    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