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

XF 1.4 page URL problem in threads list

#1
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
 

Mike

XenForo developer
Staff member
#2
Can you provide us an example where we can see this? (I'm unable to load the URL in your customer account.)
 
#3
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
HTML:
http://forum.studentville.it/forums/matematica.41/
it loads but it will not be loaded if you go to page 2 or so on
 

Brogan

XenForo moderator
Staff member
#4
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?
 
#5
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:

Mike

XenForo developer
Staff member
#6
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.
 
#10
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']);
        }