1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Not a Bug Route Filter doesn't 301 to new URI

Discussion in 'Resolved Bug Reports' started by rellek, Aug 12, 2013.

  1. rellek

    rellek Well-Known Member

    Let's say you change that threads/example.1/ thing to topic/example.1/ and you request the old URI, there is a redirection to the new URI.

    However, checking HTTP headers, it seems like no 301 is thrown which is kind of unfortunate, I guess.
    Hoffi, Omega, Triops and 1 other person like this.
  2. Mike

    Mike XenForo Developer Staff Member

    Some of it is down to whether or not we canonicalize on the particular page, which we don't necessarily do on every page so in that regard it may be expected. However, those pages aren't really the primary ones.

    In your particular example, I get a 301. The fact that you're seeing the URL change means that there is a redirect happening, so what redirect code are you seeing?
  3. rellek

    rellek Well-Known Member

    To not screw up my pages in Google index, I made another filter. There's a static page called "privacy". I set the route filter to



    So if you request

    you will be redirected to

    However, I don't actually know how. :D
    Because if you check the header from the old URI, you'll get a 200 OK:

    If you try to call an old vBulletin link, there is a 301. Like here:


    Those are the official redirection scripts from back then (March 2011, I believe).

    Btw, from here:

    to there:

    There's no visible 301 either.
  4. Mike

    Mike XenForo Developer Staff Member

    Either the results of that script are cached or its just plain wrong. You can see the 301 in Chrome:

    rellek likes this.
  5. rellek

    rellek Well-Known Member

    Okay, wget confirms that. Nevermind then.
  6. rellek

    rellek Well-Known Member

    Okay, I contacted the guy who hosts that script. He told me that both wget and Chrome are going for the GET request where his tool goes for the HEAD request. Asking curl for the headers of /threads/310/ results in the same as the tool shows. I.e. no 301 but 200.

    murathd:~ rellek$ curl -I http://www.wewota.de/threads/310/
    HTTP/1.1 200 OK
    Date: Tue, 13 Aug 2013 15:52:12 GMT
    Server: Apache/2.2.16 (Debian)
    X-Powered-By: PHP/5.4.17-1~dotdeb.0
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-control: private, max-age=0
    Set-Cookie: xf_session=29484b2c56de8693d5a44c47f5728489; path=/; httponly
    X-Frame-Options: SAMEORIGIN
    Last-Modified: Tue, 13 Aug 2013 15:52:12 GMT
    Content-Length: 67578
    Vary: Accept-Encoding
    Content-Type: text/html; charset=UTF-8
    murathd:~ rellek$ 
    So this is just for me to understand; how does this work in XenForo? Are there differences between a usual GET/POST request and a HEADER request or is there maybe something that could cause trouble?

    That asked, I don't actually consider this a bug any more, I'd just like to understand :)
  7. Mike

    Mike XenForo Developer Staff Member

    I believe we only do the canonicalization on GET requests. I suppose we could do it on HEADs as well but it's the sort of thing that isn't how a browser (or search engine) requests it.
    rellek likes this.

Share This Page