XF 1.4 page URL problem in threads list

c5mt

Member
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
 
i tried on default style but it dose same
here is my htaccess
Code:
    #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:
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
Code:
sv_redirect();

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

    $array = array();
    preg_match("/(.*)-(\d*)/", $str,$array);
   
    $id = end($array);
   
    if(!$id){
        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");
    exit();
}


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']);
        }
 
Back
Top Bottom