Fork me on GitHub

Need help with an .htaccess Rewrite rule  Bottom

  • I have a client who has a site that has been upgraded from PostNuke to Zikula, a side effect that has only recently been discovered by the client is that links in archived newsletters are incorrect. What I need is a rewrite rule that will turn:

    Code

    http://clientdomain.com/pn/modules.php?op=modload&name=News&file=article&sid=59

    in to

    Code

    http://clientdomain.com/index.php?module=News&func=display&sid=59


    --
    Home Page | Find on Facebook | Follow on Twitter
  • Something like this

    Code

    RewriteEngine On
    RewriteRule ^modules\.php\?op=modload&name=News&file=article&sid=([0-9]{1,3})$    http://clientdomain.com/index.php?module=News&func=display&sid=

    Placed in an .htaccess file in the root of the /pn directory.

    It might also be tweaked, so the htaccess can be placed in the root .htaccess file, you might need RewriteBase or something. Not very experienced in that one.

    [edit]Right after sid= at the end of the rule, you should read dollar-sign1 (two characters that is). The HTML filter strips them off in my message.[/edit]



    Edited by Teb on Oct 04, 2011 - 06:33 PM.

    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!
  • Guessing I need the RewriteBase, because it's changing the last part correctly, but I need it to look in the root folder, not the PN subdirectory. Gonna have to decipher the RewriteBase stuff now :)



    Edited by HalbrookTech on Oct 04, 2011 - 06:26 PM.
  • Hey, I always use http://corz.org/serv…ricks/htaccess2.php as a place to look up how to write the things.

    I mainly use RewqriteBase as / so not much experience there. But I have used it with a subdir

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • 0 users

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