I am on a windows server with IIS. Currently it is windows 2003 with IIS 6, but I will soon upgrade to 2007 and IIS 7. However, I am using the third party IIS Mod-Rewrite from Micronovae, so I think the code should apply the same as running Apache.
I am currently testing code, and have found that I am getting the desired effect, however, I get the feeling I may be grossly misusing the rewrite rules, as I have not seen it done like this in the forum. The goal is to have a URL like: http://www.something.com/subTopic/116/HeartHealth
replace a URL like: http://www.something.com/index.cfm/fuseaction/center.subTopicID/116/HeartHealth
while displaying the first URL in the browser. Also, I need to make sure that all the old URLs still work, but redirect to the new, cleaner URL.
The code below redirects the URL to the new convention with a redirect, and then points back to the original without a redirect, so that the new URL is displayed in the browser. It works to type in either convention. I will point all internal links to the new URLs, but my concerns are:
1. Will search engines penalize me for having duplicate content. I.e. you can get the same content via two URLs OR will they not follow the old links anymore, because of the redirect(do I need to add a 301 somehow?)
2. The regex rule seems to be working, but I'm not sure if my wildcards and end of expression syntax may produce unexpected results.
3. Is there a better way to do this?
I would appreciate any help you can give me. Thanks.
RewriteRule ^/index.cfm/fuseaction/center.subTopic/subTopicID/(.*)$ /subtopic/$1 [R]
RewriteRule ^/subtopic/(.*)$ /index.cfm/fuseaction/center.subTopic/subTopicID/$1