Redirect Only?

Topics: User Forum
Apr 13, 2012 at 2:17 AM
Edited Apr 13, 2012 at 2:20 AM

Hi. I'm newbie... I have read the documentation, reviewed the sample .ini files and searched these forums but did not find something that specifically addresses what I'm trying to do, which is actually very simple. I have been able to get it to work but have also had some unexpected results. Unfortunately, I have almost no knowledge of regex but I'm also not trying to rewrite.

I'm really just looking to do redirects and have an ini file that contains lines like this:

StatusInquiry ON RemoteOk
RewriteLog c:\temp\iirf
RewriteLogLevel 2

RedirectRule ^/index.asp$ http://www.mydomain.edu/ [R=301]
RedirectRule ^/academics/accreditation.asp$ http://www.mydomain.edu/about/accreditation.aspx [R=301]
RedirectRule ^/academics/advance/advance_program.asp$ http://www.mydomain.edu/academics/business/advance/ [R=301]
RedirectRule ^/offices/study_abroad/$ http://www.mydomain.edu/academics/study_abroad/ [R=301]
RedirectRule ^/offices/study_abroad/contact.asp$ http://www.mydomain.edu/academics/study_abroad/contact.aspx [R=301]
RedirectRule ^/offices/study_abroad/index.asp$ http://www.mydomain.edu/academics/study_abroad/ [R=301]
RedirectRule ^/student_life/docs/gym_calendar.htm http://www.mydomain.edu/campus_life/docs/gym_calendar.htm [R=301]
RedirectRule ^/welcome/news/ http://www.mydomain.edu/news-center/ [R=301]


There are about 450 RedirectRule items and because we significantly changed the structure of the site and naming conventions, only about 10% of these have an identical path and file name as they did previously with the only difference being the file extension (was .asp, now .aspx).

My setup is Win2003/IIS6 and I tested IIRF successfully with a different site on a staging server first. However, when I put it into production at its ultimate destination it works but I also get results I didn't expect. From the log file (RewriteLogLevel 2 for the moment) :

++sample 1

Thu Apr 12 19:35:47 -  5080 - DoRewrites: Url (decoded): '/offices/study_abroad/index.asp'
Thu Apr 12 19:35:47 -  5080 - DoRewrites: Redirect (code=301) Url to: 'http://www.mydomain.edu/academics/study_abroad/'

That's perfect!

++sample 2

Thu Apr 12 19:36:39 -   924 - DoRewrites: Url (decoded): '/current_students.asp'
Thu Apr 12 19:36:39 -   924 - DoRewrites: Redirect (code=301) Url to: 'http://www.mydomain.edu/current_students.aspx'
Thu Apr 12 19:36:39 -  7968 - DoRewrites: Url (decoded): '/current_students.aspx'
Thu Apr 12 19:36:39 -  7968 - DoRewrites: No Rewrite
Thu Apr 12 19:36:40 -  7968 - DoRewrites: Url (decoded): '/_resources/css/all.css'
Thu Apr 12 19:36:40 -  7968 - DoRewrites: No Rewrite
Thu Apr 12 19:36:40 -  7968 - DoRewrites: Url (decoded): '/_resources/js/jquery.simpleWeather.js'
Thu Apr 12 19:36:40 -  7968 - DoRewrites: No Rewrite
Thu Apr 12 19:36:40 -  7968 - DoRewrites: Url (decoded): '/_resources/js/weather.js'
:
:
: (all the other files on /current_students.aspx page are also listed)

The redirect works great but then all the links in the page also seem to be parsed.

++sample 3

Thu Apr 12 19:38:57 -  6428 - DoRewrites: Url (decoded): '/'
Thu Apr 12 19:38:57 -  6428 - DoRewrites: No Rewrite
Thu Apr 12 19:38:58 -  7968 - DoRewrites: Url (decoded): '/_resources/css/all.css'
Thu Apr 12 19:38:58 -  7968 - DoRewrites: No Rewrite
Thu Apr 12 19:38:59 -  7968 - DoRewrites: Url (decoded): '/_resources/js/jquery-1.6.1.min.js'
Thu Apr 12 19:38:59 -  7968 - DoRewrites: No Rewrite
Thu Apr 12 19:38:59 -  7968 - DoRewrites: Url (decoded): '/_resources/js/jquery.tweetslider.min.js'
Thu Apr 12 19:38:59 -  7968 - DoRewrites: No Rewrite
Thu Apr 12 19:38:59 -  6428 - DoRewrites: Url (decoded): '/_resources/js/analytics.js'
Thu Apr 12 19:38:59 -  6428 - DoRewrites: No Rewrite
Thu Apr 12 19:38:59 -  6428 - DoRewrites: Url (decoded): '/images/global/t-left.jpg'
Thu Apr 12 19:38:59 -  6428 - DoRewrites: No Rewrite
Thu Apr 12 19:38:59 -  7968 - DoRewrites: Url (decoded): '/images/global/bg-wrapper.gif'
Thu Apr 12 19:38:59 -  7968 - DoRewrites: No Rewrite
Thu Apr 12 19:38:59 -  2092 - DoRewrites: Url (decoded): '/images/home/backdrop_student_group.jpg'
Thu Apr 12 19:38:59 -  2092 - DoRewrites: No Rewrite
:
:
: (all the other files on the home page are also listed)

Same thing but not initiated by a redirect request. Also happens for other files in the site in longer paths like /computing/moodle.aspx.

Here's my question: In sample 2 & 3 are all the additional entries supposed to be there? Or have I gotten something wrong? It seems ok, but definitely a reason to have RewriteLogLevel 1 or 0?

I feel like I'm nearly there and would appreciate some clarification if I'm missing something and a little push in the right direction.

Thanks so much for your time.