XF 1.4 page URL problem in threads list

i have a little problem with pages url when threads are listed
it gives page not found on url domain.com/forum/thread-title.123/page.2
when i mouse over on page number it shows as domain.com/forum/thread-title.123/page-2 but goas to dot on loading and give error.
where the problem could be


XenForo developer
Staff member
Can you provide us an example where we can see this? (I'm unable to load the URL in your customer account.)
Can you provide us an example where we can see this? (I'm unable to load the URL in your customer account.)
Here is exact URL
it loads but it will not be loaded if you go to page 2 or so on


XenForo moderator
Staff member
Your installation is quite heavily customised.

Does it work in a default style and language with all add-ons disabled?

Hovering over the pagination link, it correctly shows with a -, so something is rewriting it to a .

Ahh, interesting, that time it tried to load with the - and I got a redirect loop: http://forum.studentville.it/forums/matematica.41/page-4
Do you have anything in .htaccess?
i tried on default style but it dose same
here is my htaccess
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

  #RewriteRule ^(.*)/([0-9]+)-(.*).html$ /threads/$3-$2/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]

    RewriteCond %{REQUEST_FILENAME} -l [OR]

    RewriteCond %{REQUEST_FILENAME} -d

    #RewriteRule ^.*$ - [NC,L]

    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]

    #RewriteRule ^.*$ index.php [NC,L]
This is also customized i uploaded it default one from package files however now it gives error
This webpage has a redirect loop where it could be
Last edited:


XenForo developer
Staff member
I'm confused as to why there are standard rules that have been commented out there.

The redirect doesn't appear to be related to XF itself as there's a header that XF generates on any page that is output in the "standard" way. It does look like it may be generated via PHP though. Please confirm with the default .htaccess and all add-ons disabled.
custom to site
found this code in index

function sv_redirect(){
    $str = router301_full_url();

    $array = array();
    preg_match("/(.*)-(\d*)/", $str,$array);
    $id = end($array);
        return false;
    $pos = strpos($str,$id)-1;
    $char = substr($str,$pos,1);
    if($char == '-'){}
    $string = str_split($str);
    $string[$pos] = '.';
    $string = implode($string);
    header("HTTP/1.1 301 Moved Permanently"); 
    header("Location: $string");

function router301_full_url()
           $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
           $sp = strtolower($_SERVER["SERVER_PROTOCOL"]);
           $protocol = substr($sp, 0, strpos($sp, "/")) . $s;
           $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
           return utf8_encode($protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI']);