Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Goto page: [-1] 1 - 2 - 3 - 4 - 5 - 6 [+1]

Bottom
Proposal for Better ShortURLs
  • Posted: 05.08.2005, 20:40
     
    msandersen
    rank:
    Professional Professional
    registered:
     August 2002
    Status:
    offline
    last visit:
    25.11.05
    Posts:
    994
    As I also said in the I.M.:
    No, not something you are doing wrong. The error is a Server error related to the rules. I haven't had Apache 1.3 installed in a while, so couldn't test on it.

    However, I've just downloaded and installed it, and done a quick test. Turns out there is one more rule where I've inadvertently used a more modern syntax. If you're not technical, it may be better if I uploaded a fixed htaccess file. I may have time to test properly tomorrow. In the meantime, the rule causing your trouble, apart from the 2 PostCalendar Rules, is under Sections (open in a text editor, eg NotePad, and use its Search function to look for "Sections"):

    Under
    # Sections
    2nd rule starting with

    Code

    RewriteRule ^Sections[/-]Article([0-9]+)(?:-p)?-?[^\.]*\.p?html?$

    (I'm not showing the rewritten URL portion)

    The thing Apache 1.3 doesn't like is the (?:-p) bit, change that to (-p), ie

    Code

    RewriteRule ^Sections[/-]Article([0-9]+)(-p)?-?[^\.]*\.p?html?$


    That fixes the problem.
  • Posted: 06.08.2005, 03:23
     
    beancounter3
    rank:
    Freshman Freshman
    registered:
     February 2005
    Status:
    offline
    last visit:
    19.09.05
    Posts:
    12
    Thanks very much.
    Yes that did the trick.

    The modules not working properly with shorturls are pnForum and postwrap.

    I can switch the forum to PNphpBB2

    Could you provide a little more advice help on how to set up the .htaccess file for postwrap please.

    Also if I activate session IDs ie remove the # on the second line below, I get error 500.
    # Turns off PHP session IDs, which cause problems with search engines
    #php_flag session.use_trans_sid off

    How much does this matter?

    Many thanks
    Beano
  • Posted: 06.08.2005, 03:58
     
    beancounter3
    rank:
    Freshman Freshman
    registered:
     February 2005
    Status:
    offline
    last visit:
    19.09.05
    Posts:
    12
    There is another problem.

    The second tier menu's for Pagesetter are not working.

    They are all throwing up the home page.

    Hope someone can help with this.

    Beano
  • Posted: 06.08.2005, 21:04
     
    msandersen
    rank:
    Professional Professional
    registered:
     August 2002
    Status:
    offline
    last visit:
    25.11.05
    Posts:
    994
    Firstly, and I should update the ReadMe to reflect this, if you're using a Xanthia theme as you are, update your templates so that under the Head tag you have a Base tag like this:

    Code

    <head>
    <base href="<!--[pngetbaseurl]-->">

    You should do this for all your templates, in /templates/master.htm and all of the /templates/module/ files
    This will help with the 3rd party modules.

    I have a test install of pnForum 2.01, and it works fine. If you add the Base tag, that may fix your problem. Your link to the Forums in the top menu is a part of the templates themselves, and it reads http://www.growyour.biz/?module=pnForum&func=viewforum&forum=1, without the index.php.
    I've never used Pagesetter, so when you say the 2nd tier menus, you mean the Hints and Tips side block that appear like /pagesetter-tid:3-filter:Category^sub^1.html? The urls don't look right, the format should be
    /module/function-parameter:value.html
    ie /pagesetter/[function]-tid:3-filter:Category^sub^1.html
    For instance, /pagesetter/main-tid:3-filter:Category%5Esub%5E8.html from your site does work.
    It seems like Pagesetter is sending the variable Func as empty. If it is, then that is a Pagesetter bug.
    What would be the full URL for such a link? Does it have &func= with no value?
    If not, it may be it's created with the Xanthia filter and there's a bug in a rule there.

    About php_flag session.use_trans_sid off
    I have read of people whose server setup doesn't like this setting for whatever reason. Maybe it's PHP version. I tested on Apache 1.3.33, the same as on your host, but I don't know your version of PHP. In any case, by default in PN it doesn't use Session IDs, as set by this PHP command:
    // Stop adding SID to URLs
    ini_set('session.use_trans_sid', 0);
    The 0 turns it off. That's the default, so no need to change that.
    The issue is that whereas search engines have been getting better at handling dynamic sites, SE's like Google say their Googlebots still have trouble with Session IDs on URLs, since the ID changes all the time, and hence the same URL looks like a different one, and it may trawl the same content relentlessly.

    The trouble with PostWrap is that it relies on frames, which is definitely not Search-Engine Friendly. The SEs will only see a frame, but not the linked content. That's one of the main points of the module I wrote, NukeWrapper, which includes the wrapped page into PostNuke instead. I've never gotten around to writing the Admin part (I'm not really a developer), so not nearly as user-friendly. It's configured maually. There's a fairly detailed ReadMe here. Most simple usage, only using the page.php file, editing it directly to configure which directories may have content included, and changing any default options. The rest is not essential. There's a module version, where as mentioned I haven't written the Admin section yet, but works just fine. For not, it's configured from /moduels/NukeWrapper/NukeWrapper.conf.php. It works the same, just different (longer) URL. I also haven't written a block for it yet.

    There is a module called xSiteMap, which aims to produce a sitemap for WebSpiders. Any indexable link on the front page can help too. For instance, if you wrote your own sitemap HTML file and included it with something like NukeWrapper (PostWrap won't work, by virtue of its use of frames), with a simple link on the top menu, then WebSpiders will be quickly able to trawl the site.
  • Posted: 07.08.2005, 00:52
     
    beancounter3
    rank:
    Freshman Freshman
    registered:
     February 2005
    Status:
    offline
    last visit:
    19.09.05
    Posts:
    12
    Many thanks for this information.
    I didnt realise that Postwrap was so search engine unfriendly. From my point of view there is absolutely no point in using it. I shall switch to Nukewrapper ASAP.

    I have found another problem. When I try to add a new block I get message
    'Block load failed'

    Thanks for your help
  • Posted: 07.08.2005, 04:01
     
    beancounter3
    rank:
    Freshman Freshman
    registered:
     February 2005
    Status:
    offline
    last visit:
    19.09.05
    Posts:
    12
    The Pagesetter pages themselves seem to be fine, but the menus (generated by Pagesetter) are not working
    They are throwing up the home page. eg

    http://www.growyour.biz/pagesetter-tid:3-filter:Category%5Esub%5E7-cv:7.html

    or http://www.growyour.biz/pagesetter-tid:3-filter:Category%5Esub%5E6-cv:6.html

    As you say http://www.growyour.biz/pagesetter/main-tid:3-filter:Category%5Esub%5E8.html throws out the main menu, but I'm not sure this is right.

    The main menu should be (I think)
    http://www.growyour.biz/pagesetter/main-tid:3.html
    it is the links from this page that do not seem to work. The URL's above should be coming up with 'sub' menus.

    But
    http://www.growyour.biz/pagesetter/main-tid:3-filter:Category%5Esub%5E6-cv:6.html

    does seem to work. So it looks like the' /main' is being left out of the URL that is being generated.


    Regards
    Beano
  • Posted: 07.08.2005, 17:27
     
    beancounter3
    rank:
    Freshman Freshman
    registered:
     February 2005
    Status:
    offline
    last visit:
    19.09.05
    Posts:
    12
    Looks like there are some challenges to using short URL's with Pagesetter

    Here is a link

    http://www.elfisk.dk/index.php?module=Pagesetter&func=viewpub&tid=9&pid=29
  • Posted: 07.08.2005, 19:25
     
    msandersen
    rank:
    Professional Professional
    registered:
     August 2002
    Status:
    offline
    last visit:
    25.11.05
    Posts:
    994
    I've downloaded Pagesetter 6.2 Beta, i'll be testing it soon, but it's a big module, so there's a bit to take in. I had a look at the URLs on Jørn's Elfisk site, one thing I note is that the "func" parameter is missing, eg here.
    I had a quick look at the code, and in the Pagesetter block pub.php, there is a definite bug. It's passing the variable $func to the core URL function, pnModURL, but the variable is not defined anywhere. Hence it is empty. That is why the URLs have an empty func parameter, and is the one way I can see where the ShortURLs don't include the function part, because the one condition is that the function not be empty.
    So my initial assesment is that it is due to a bug in the Pagesetter block. I could modify the ShortURL code so that if the Function is empty, it will use 'main'. That will bybass this bug.

    To do it yourself, open /includes/pnMod.php in a text editor
    Use Search to find "pnModURL" (it should be line 734)
    The first few lines of the funciton reads:

    Code

    function pnModURL($modname, $type='user', $func='main', $args=array(), $ssl=null, $fqurl=null) {
      // begin ShortURL change by msandersen 22/03/2005
      if (empty($modname))  return false;

    After this, add

    Code

    if (empty($type)) $type = 'user';
      if (empty($func)) $func = 'main';

    It's a failsafe setting defaults, and should resolve the missing Function argument.

    Those shorturls in the link refer to the Xanthia filter ShortURLs, I cannot be sure it is relevant to this implementation without testing, since I've removed those particular rules from the filter, since links for new modules are generated by the core. You can test on your own site to see. You can apply the htacces rules as suggested in the posts otherwise.
    One good thing about this ShortURL implementation is that a module can have a custom ShortURL plugin to generate specific shortURLs much like the Xanthia filter rules discussed in the forum. But it requires some study of the generated URLs and testing.
  • Posted: 08.08.2005, 20:12
     
    thinkingtoo
    rank:
    Freshman Freshman
    registered:
     July 2005
    Status:
    offline
    last visit:
    21.08.05
    Posts:
    18
    EDIT:sorry, didnt see page3, found the solution


    BTW, itz GREAT!
  • Posted: 10.08.2005, 21:31
     
    msandersen
    rank:
    Professional Professional
    registered:
     August 2002
    Status:
    offline
    last visit:
    25.11.05
    Posts:
    994
    Thanks.

    I've updated the packages, including a cumulative update patch for PN0.76rc4 with all the things discussed here, in particular
    - Filtering of HTML tags and illegal characters in Titles of URLs.
    - Changes in the htaccess file for Apache 1.3
    - Tweak of pnModURL function
    Pn0.76rc4 ShortURL Update
    PN0.76rc4 ShortURL package - full
    Pn0.75 ShortURL package

    I'll do an update once PostNuke 0.76 Final is released, as time permits.
  • Posted: 20.08.2005, 01:12
     
    deseee
    rank:
    Freshman Freshman
    registered:
     March 2004
    Status:
    offline
    last visit:
    20.12.05
    Posts:
    39
    msandersen: Just thought you should know that the Pn0.75 package worked for the most part on my site. everything except the .htaccess file. so I had to replace it with the old xanthia .htaccess. what would happen is I could get to say www.site.com/faq/index.phtml but when I would click on any other link I would get www.site.com/faq/user.phtml if i clicked on the user or www.site.com/faq/topics.phtml if i clicked on topics etc.
    news articles still had the old www.site.com/articlexxx.phtml. Let me know if you need any more information or if you want to take a look at the site with your .htaccess file because my site isn't live yet.
  • Posted: 20.08.2005, 22:36
     
    thinkingtoo
    rank:
    Freshman Freshman
    registered:
     July 2005
    Status:
    offline
    last visit:
    21.08.05
    Posts:
    18
    You know how you should do it next?

    you should make everything go in directories
    wo things would be like mysite.com/my_module/
    mysite.com/anothermodule/page44
    etc
  • Posted: 20.08.2005, 23:57
     
    msandersen
    rank:
    Professional Professional
    registered:
     August 2002
    Status:
    offline
    last visit:
    25.11.05
    Posts:
    994
    desee
    I bet you're using a Xanthia theme. Download the updated PostNukeBlue or SeaBreeze themes I posted somewhere around here and try it with them. The included ReadMe is also updated to include information on what needs to be changed in the Xanthia templates, specifically adding the tag underneath the tag:

    Code

    <head>
    <base href="<!--[pngetbaseurl]-->">

    If you added the whole package, in your case specifically the News and Xanthia updates, then you should be getting the new URLs. Not replacing includes/pnAPI.php might also cause it. The new Xanthia ShortURL output filter should also have fixed links in older modules or themes. The BASE tag also takes case of this. I haven't tried the new URLs with the old htaccess file, but it shouldn't work. So if you uploaded everything, I'm not sure why you're getting 'old' behaviour.

    The PostNukeBlue and SeaBreeze theme updates have been accepted into CVS, and the other default themes have been similarly fixed with the Base tag, so some of the groundwork seem to be done.
  • Posted: 21.08.2005, 20:42
     
    imranbaig
    rank:
    Freshman Freshman
    registered:
     March 2005
    Status:
    offline
    last visit:
    03.11.06
    Posts:
    14
    after conversion of urls as you specified, in a package for PN 0.750 it worked all well and still it is working very well the problem is that when ever I access PNphpBB2 module I get erros, as shown.

    Quote


    Warning: Missing argument 1 for smarty_function_title() in /home/winkeyfi/public_html/modules/Xanthia/plugins/function.title.php on line 54

    Warning: Missing argument 2 for smarty_function_title() in /home/winkeyfi/public_html/modules/Xanthia/plugins/function.title.php on line 54

    Warning: extract(): First argument should be an array in /home/winkeyfi/public_html/modules/Xanthia/plugins/function.title.php on line 56


    All though the forum is working fine excpt these errors in the header!
    What miss configuration would have cuased this?
  • Posted: 21.08.2005, 23:29
     
    msandersen
    rank:
    Professional Professional
    registered:
     August 2002
    Status:
    offline
    last visit:
    25.11.05
    Posts:
    994
    I seem to remember someone else having this problem somewhere, I believe in that case it was due to a corrupted file upload. The error says the Title plugin called from a Xanthia template hasn't supplied the default variables needed.
    Another possible problem is the version number of PNphpBB2. My version is 1.2g. What's yours?
    You could try re-uploading the original PNphpBB2 files that are replaced (see the package), then edit /templates/PNTheme/headerBB2.php and around line 96 (in my version) where the tag is output, add the tag:
    echo "\n\n\n";

    If you're using a newer version, there may be incompatible changes to the patch. I'll have to check.

Goto page: [-1] 1 - 2 - 3 - 4 - 5 - 6 [+1]

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula