Rewrite rule help needed

I’ve got a clients site that was upgraded from the PostNuke CMS to Zikula. In the process of the upgrade, the person who did the upgrade moved the site from living in the subfolder /pn/ to being the root of the domain. The problem I’m running in to now, that they have only just discovered, is that they have old links to things in the subfolder. So, what I need to do is change the following url example:
[URL=“http://member.eatongenealogy.com/pn/modules.php?op=modload&name=News&file=article&sid=59”]http://clientdomain.com/pn/modules.php?op=modload&name=News&file=article&sid=59

to

[URL=“http://member.eatongenealogy.com/index.php?module=News&func=display&sid=59”]http://clientdomain.com/index.php?module=News&func=display&sid=59

I have a rewrite rule:

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

That reforms the file reference, but the problem is I need the /pn/ to be changed to / as well. I tried adding pn\ to the rule, I tried putting it in the /pn/ folder, but so far I’m not getting anywhere.

M,

That’s a simple matter of understanding the Apache Redirect directive. I’ll let you find all the alternatives but

Redirect 301 /np/ http://clientdomain.com/

should do the trick for you.

Regards,

DK

Thanks, I’ll give it a shot, and that should go in the web root, not the sub folder correct?

MH,

Correct … but the format I provided was with absolute paths to your DocumentRoot so it shouldn’t matter. As a technique, I try to do everything in the DocumentRoot’s .htaccess file to avoid confusion about directory levels.

Regards,

DK