TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 606
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 255
  • Total: 255

double slash in URL

Started by freeman78, December 11, 2007, 07:31:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

freeman78

now I have uncommentet the Rewriting for the TP URL´s but still the same...

IchBin

TP doesn't re-write the URL. It only writes the URL once. It doesn't use them in any other way like the SEO mod does. What you're asking is something that needs to be changed in the SEO mod and not TP.

MazdaClubTR

#12
I found out that the problem is with SE04SMF package.  From webmasterstalks site we can see that SMF 1.1.4, TinyPortal 0.9.7 and SEO4SMF are working fine but SEO4SMF is having difficulty in beautifying portal article urls with 0.9.8.

The translations of urls start from ;

$path_name = "";
    if (function_exists('TPortal_init'))
    if ($type == "page") //tinyportal
    {
if (is_numeric($tpage_id))
{

        if (isset($context['TPortal']))
        {
            if (isset($context['TPortal']['boardnews']))
            {
                foreach($context['TPortal']['boardnews'] as $bnews)
                {
                    if ($bnews['id'] == $tpage_id)
                    {
                        $path_name = strip_tags($bnews['subject']);
                        $path_name = remove_signs($path_name);
                        $path_name = strtolower(str_replace(" ", $split_char, $path_name));
                         
                        return $path_name."-p".$tpage_id.".html";
                    }
                }
            }
             
            if ($path_name == "")
            {
                $path_name = scan_tp_sql($tpage_id);
                return $path_name."-p".$tpage_id.".html";
            }
             
        }


in Subs-Seo4SMF.php in Sources directory. and since it cant get in the upper loop, it executes the following.
} else return "/index.php?dummy=1;page=".$tpage_id;

if you replace "/index.php" with "index.php" you will get rid of double slash but we should ask why the upper part is not working.

MazdaClubTR

I think I found the reason ;

As you can see the code begins with

if (is_numeric($tpage_id))

But the page id in the url comes as ;

http://www.otworld.de//index.php?page=Knieorthese

So, since the page id is Alphabetic instead of numeric, the code cant beautify the url and passes a string as

http://www.otworld.de//index.php?dummy=1;page=Knieorthese

I see that the page id in tinyportal.co.uk is numeric. Is it a way to convert these ids to numaric ?

freeman78

@MazdaClubTR

you were right; if you replace "/index.php" with "index.php the double / is vanished, but the beautifying of URL still doesn´t work. Everything else seems 2b OK

MazdaClubTR

#15
@freeman78

Good to hear that it helped a bit.

The problem lies on how TP writes the URL . You can see that at home page of this site the article id is displayed numeric ;

http://www.tinyportal.net/index.php?page=77

where both on your site and on my test site they are displayed as alphanumeric. If we can make TP write page ids as numeric the problem will be solved..

freeman78

OK; I try 2 find something....; your method of resolution sounds like a good idea...

freeman78

don´t you think, that its more easy to change the following string in the .htaccess...


#Tiny Portal Old Url's
RewriteCond %{QUERY_STRING} ^page=([0-9]*)
RewriteRule  ^(.*)$ seo4smf-redirect.php?p=%1 [R=301,L]


like the rewriting for actions?

MazdaClubTR

First I should tell that I dont have much of a knowledge on PHP but looking at the code it looks for strings as ;

page=<number>

how will you be changing the code where your TP send links as ;

page=Knieorthese

Besides the code you refer on .htaccess has affect only when you write the url on browsers address bar. The beautifying is completely done on Subs-Seo4SMF.php as far as I have seen.

Something should be done on TP side..

bloc

In 0.9.8 any page is written as page=alphanumeric..it uses the article's "short-title" field. If it doesn't  contain anything the id is used. So both page=mypage and page=34 is valid. This will not change for any other mod's benefit I am afraid, its one of TP's features to be able to use both ways.

I don't quite understand why this mod can't use alphanumeric as well as numeric values though, since it can apparently beautify topic numbers? But i suspect its because its written for 0.9.7 where ONLY id's were used for page=.

...One of the goals of TP 1.0 will be to expand the built-in SEO of SMF to also convert TP query-strings though, I am hoping that will make things better for the SEO aspect.

This website is proudly hosted on Crocweb Cloud Website Hosting.