#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1

    Strange url to redirect 301


    Hello Requinix
    I have 400 Access denied on Search Google error 403 on this URL

    https://www.mysite.it/?%3C!DOCTYPE%2...UBLIC&page=104
    https://www.mysite.it/?%3C!doctype%2...ublic&page=100

    I writed on forum google and someone tell me to make redirect 301.. but there are special characters...

    It's possibile applied your solution in this link https://goo.gl/fSq1k9

    I see that %3C is <

    %20 is SPACE but in URL traduction is +

    What do you think?

    Can you help me?
    Thanks
    Fabrizio
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1
    When i click on link on my site i see this URL

    https://www.mysite.it/?<!DOCTYPE html PUBLIC&page=212

    and homepage of my site....
  4. #3
  5. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,700
    Rep Power
    9646
    If your site is creating that link then it is a problem and you have to fix it. Then you don't have to worry about doing any redirections.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1
    I did the migration from asp.net to wordpress and I do not know where that URL comes from, I do not know if it comes from the old blog or it's because of the new blog.

    if I knew how to correct it, I had already done it :-(

    In the search google forum say to make 301 redirect you do not agree?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1
    It's not possibile to make redirect

    from
    https://www.mysite.it/?<!DOCTYPE html PUBLIC&page=212

    to
    https://www.mysite.it/

    What do you think? I can use RewriteCond for DOCTYPE or doctype?
  10. #6
  11. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,700
    Rep Power
    9646
    Getting real tired of people contradicting themselves.

    You have said
    Originally Posted by fabry19dice
    When i click on link on my site i see this URL
    and now you're saying
    Originally Posted by fabry19dice
    I do not know where that URL comes from
    Which one is the truth and which one is a lie?
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1
    Sorry You are right!

    I click from Search Console and not by my site!

    Second it's true :-)
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1
    I reread well what I wrote, the comma was missing :

    When i click on the link, on my site i see this URL
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1
    I tried so

    Code:
    RewriteCond %{QUERY_STRING} doctype([^&]+) [NC]
    RewriteRule ^/?$ /$1/ [L,NC,NE,R=301,QSD]
    but don't redirect
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1
    I solved so in index.php

    Code:
    if (strncmp($_SERVER["REQUEST_URI"], "/?<!doctype ", 12) != 0 || strncmp($_SERVER["REQUEST_URI"], "/?ta<!doctype ",14) !=0) {
        http_response_code(301);
        header("Location: https://www.mysite.it");
        exit;
    }
    Thankss
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2018
    Posts
    65
    Rep Power
    1
    Yes but how to solve? Do you have suggestion?

IMN logo majestic logo threadwatch logo seochat tools logo