how to change the format of shorturls  Bottom

Go to page 1 - 2 [+1]:

  • hello, i am migrating form postnuke 0764 to zikula and i have realized that the format of the urls are diferent, this is a big problem for me because the links that other webs have of my old links with the old format will not work anymore...and besides i think that all the hits that i already have in google will also lost and i will lost the pagerank...the fact is that i have discovered the file where one can to change the built of this urls, but i dont know how to do it...(outputfilter.shorturls.php)
    i need to change this: module-News-display-sid-417.html
    by this:article417.html

    someone could to help me please...i would like to solve this problem that i think is a big problem...by the lost of the pagerank in google and links in others webs that point to the old links...



    edited by: mercromina, datetimebrief

    --
    www.ahorradores.net
  • I edited Wiki: ShortURLs - Further Customizations with information already available on this forum. It's for creating custom URL's for PNphpBB2 instead of News, but you get the picture.

    Of course, you need to modify the URL's to reflect your personal wishes. Hope you're able to do so and play around with it.

    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!
  • ok thanks :) i will try to do it with that informatión... i have been reading it and for me it is dificult but i will try and i will tell us if i get it...and the solution...but if someone had to do the same change and wants to save me the suffer...i will be very happy icon_biggrin

    --
    www.ahorradores.net
  • In your case, follow the same steps, but change the following.
    • point 2: In /config/plugins/outputfiler.customurls.php, the in- and out-array need to read:

      Code

      // Define the url's that need to be rewritten
              $in = array(
                  $prefix . $entrypoint . '\?module=News&(?:amp;)?func=display&(?:amp;)?sid=(\d+)"|',
              );

              // Define the customized url for this set
              $out = array(
                  '"Article.'.$extension.'"',
              );

      Notice: I previewed this message before posting, and I see that the code is not copied 100% correctly: Where you see '"Article.'.$extension.'"', it needs to be '"Article$1.'.$extension.'"',
      Don't forget this!
    • point 7: Your .htaccess file needs the following entries added to them. The exact location depends on your current content.

      Code

      # Articles
      RewriteRule ^Article([0-9]+)\.html$ index.php?module=News&func=display&sid= [L,NC,NS]
      RewriteRule ^Article([0-9]+)-([A-Za-z=]+)(-order([0-9]))?(-threshold([0-9\-]{1,2}))?\.html$ index.php?module=News&func=display&sid= [L,NC,NS]


    Additional info, specifically here for the News module:
    If you want to redirect the old-style Topic-urls to be redirected to the new category system (search-engine friendly!), the following additional lines are needed in your .htaccess file:

    Code

    # Topics
    RewriteRule ^Topic1([A-Za-z]*)?\.html$  http://example.com/module-News-view-Topic-YOURFIRSTTOPIC/ [R=301,L]
    RewriteRule ^Topic2([A-Za-z]*)?\.html$  http://example.com/module-News-view-Topic-YOURSECONDTOPIC/ [R=301,L]
    RewriteRule ^Topic3([A-Za-z]*)?\.html$  http://example.com/module-News-view-Topic-YOURTHIRDTOPIC/ [R=301,L]
    where, if you have also converted your Topics to the new categories, you need to manually finish the last lines for all your old topic-id's, and the new topic-names in the categories module they have been converted to.
    In this case:
    - Topic id 1 (under PN) has been converted to the categories module with Topicname YOURFIRSTTOPIC
    - Topic id 2 (under PN) has been converted to the categories module with Topicname YOURSECONDTOPIC
    Just look it all up and add all the needed lines.

    Hope I explained it extensively enough. At least play around with it.

    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!
  • wow thank you very much...i am going to try this :))))))))))))))))))))

    --
    www.ahorradores.net
  • it works¡¡¡ jajaja
    only one thing for other people beginner as me...it is necesary to place at the begining of the file

    Code

    <?php

    do not forget this...

    --
    www.ahorradores.net
  • Glad it worked!

    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!
  • hello, i have realized that, in spite of the URL is changed like i want, when i click in the link converted(localhost/Article417.html), this do not work and gives me this mistake:

    Quote

    Wrong¡ Arguments wrong. Please check the data and try again. The origin of this message was \'News_user_display\' at line 433 in file \'C:\\xampp\\htdocs\\modules\\News\\pnuser.php\'.


    it was so nice to be truth and work at the first time:))))))

    --
    www.ahorradores.net
  • Are you able to load index.php?module=News&func=display&sid=417 at your localhost? Does that exist? Do you get any errors there?

    Not quite sure if this is a localhost-server setting or a bad config in .htaccess. The rules are copied from a .764 installation, rewritten to the latest News-URL's. Should be just fine. What version of the News module are you using?

    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!
  • How would i do the same thing with directory urls?
  • Not possible, as I have clearly said at the mentioned Wiki page:

    ShortURLs: Further Customizations and Information

    that would allow a safe and valid way to work with your own customized file-based URL's, and is not applicable when used with directory based urls


    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!
  • Right, and I am wondering what the proper procedure for directory urls is, to do something similar.

    Like http://site.com/News/article1234
  • I think you can all set this up in the News module yourself:
    index.php?module=News&type=admin&func=modifyconfig
    • Look at the "Permalinks" fieldset at the bottom of that page.
    • Select "Custom format"
    • At the "Custom format definition" input field fill in:

      Code

      article%storyid%


    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!
  • hello Teb, yes index.php?module=News&func=display&sid=417 works, but article417.html dont work :(
    It is strange, because it seems that change fine the long URL by article417.html. I mean that when you place the mouse over the link you can read in the bottom of firefox the URL short, but if you click it, dont work.

    (the vesion of news module is '2.4.1')



    edited by: mercromina, datetimebrief

    --
    www.ahorradores.net
  • I see what is wrong.

    Re-look at my post where I wrote

    Teb

    Notice: I previewed this message before posting, and I see that the code is not copied 100% correctly: Where you see '"Article.'.$extension.'"', it needs to be '"Article$1.'.$extension.'"',
    Don't forget this!

    This ALSO needs to be applied to the code for the .htaccess file! So: Where you see
    ... &sid= [L,NC,NS]
    it needs to be
    ... &sid=$1 [L,NC,NS]
    Mind that this is at two places!

    Damn bbcode... Maybe this topic should be merged into that Wiki page too. To get all CORRECT info in at least on valueable page.
    [edit]Done, all merged[/edit]



    edited by: Teb, datetimebrief

    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!

Go to page 1 - 2 [+1]:

This list is based on users active over the last 60 minutes.