The redirection for the first file, file1.php works fine but accessing the redirection URL for file2.php shows the content of file1.php.
Any help would be appreciated.
g1smd
11:03 am on Sep 4, 2011 (gmt 0)
RewriteRule pagename/ file1.php
With no anchoring the RegEx pattern says "rewrite any request that contains
pagename/
so it matches the other requested URL too.
Add the [L] flag to every rule.
Add ^ anchoring to say begins with instead of contains.
Change the order of the rules so that rules which are more specific and affect the least number of URLs are first, and the more general rules are last.
Add your non-www to www redirect rule before these rewrites.
darkwind
11:23 am on Sep 4, 2011 (gmt 0)
Wow.
Worked like a charm.
Thanks a lot!
g1smd
11:42 am on Sep 4, 2011 (gmt 0)
Post your final code in case there are other issues to fix.