Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/hotfix truncated redirects #829

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion maps/redirects.map
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ _/apc https://www.bu.edu/ ;
_/apfd https://www.bu.edu/diversity/ ;
_/aphasia https://www.bumc.bu.edu/neurology/ ;
_/apply https://www.bu.edu/admissions-overview/ ;
_/apply/financial-aid https://www.bu.edu/finaid/ ;
_/apply/graduate https://www.bu.edu/info/admissions-overview/graduate-admissions ;
_/appspace https://cloud.appspace.com/login/ba7afe51-12c9-4347-874e-21dc25d9fc8c ;
_/archives https://www.bu.edu/library/gotlieb-center/ ;
_/arlington https://www.bu.edu/questrom/pemba/?utm_source=mbta&utm_medium=arlington&utm_campaign=mbta_arlington ;
Expand Down Expand Up @@ -103,6 +105,8 @@ _/btm https://www.bu.edu/bpt/ ;
_/btou https://www.bu.edu/buniverse/view/?v=hhLyx1Y3 ;
_/bu-nano https://www.bu.edu/nano-bu/ ;
_/bua https://www.buacademy.org/ ;
_/bua25 https://bostonu.imodules.com/s/1759/2-bu/2col.aspx?sid=1759&gid=2&pgid=5252&content_id=5396 ;
_/bualumnicenter https://trusted.bu.edu/s/1759/2-bu/giving.aspx?sid=1759&gid=2&pgid=495&cid=1167&appealcode=WEBAGC-AC ;
_/buba https://www.bu.edu/ubx/ ;
_/bubeanpotchallenge https://trusted.bu.edu/s/1759/22/form.aspx?sid=1759&gid=2&pgid=12599&cid=23829&appealcode=23BEPOTWEB ;
_/bucentral https://bucentral.wordpress.com/ ;
Expand All @@ -129,6 +133,11 @@ _/burc https://www.bu.edu/urlc/ ;
_/burppe https://www.bu.edu/sph/ ;
_/burst https://www.facebook.com/BurstBU/ ;
_/bus https://www.bu.edu/transportation/bus/ ;
_/business https://www.bu.edu/executivevp/reporting/auxiliary-services ;
_/business-analytics https://www.bu.edu/questrom/degree-programs/ms-in-business-analytics ;
_/busm https://www.bumc.bu.edu/busm/ ;
_/busmgiving https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid=2&pgid=424&cid=1063&appealcode=WEBMED-ALPR ;
_/busmphonathon https://trusted.bu.edu/s/1759/2-bu/giving.aspx?sid=1759&gid=2&pgid=424&cid=1063&appealcode=WEBMED-PH ;
_/but https://www.bu.edu/cfa/theatre/ ;
_/butheatre http://bostonu.imodules.com/s/1759/2-bu/giving/landing.aspx?sid=1759&gid=2&pgid=3691 ;
_/buti24 https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid=2&pgid=519&cid=1204&appealcode=24DAMAURL&utm_medium=appeal&utm_source=link&utm_campaign=print_bualumni&utm_term=give&utm_content=BUTI_vanity_url ;
Expand Down Expand Up @@ -184,6 +193,7 @@ _/cip https://www.bu.edu/consumer/ ;
_/claflinsociety https://trusted.bu.edu/s/1759/2-bu/19/1col.aspx?sid=1759&gid=2&pgid=15123&content_id=16989 ;
_/classroom https://www.bu.edu/classrooms/ ;
_/climate https://www.bu.edu/earth/ ;
_/climateactionplan https://www.bu.edu/sustainability/vision-progress/climate-action-plan-2/ ;
_/cme https://www.bumc.bu.edu/cme/ ;
_/cod https://www.bu.edu/provost/about/committees/council-of-deans/ ;
_/cohenchallenge https://www.bu.edu/alumni/giving/ ;
Expand Down Expand Up @@ -230,6 +240,8 @@ _/dentalassisting https://www.bu.edu/dental/ce/dental-assisting-training-program
_/dentures https://www.bu.edu/dental/dentures/ ;
_/digication https://bu.digication.com/ ;
_/digital https://www.bu.edu/dli/ ;
_/digital-strategy https://www.bu.edu/executive-courses/digital-strategy/ ;
_/digitalrevolutionevent https://secure-alumni.bu.edu/olc/pub/BUAR/event/showEventForm.jsp?form_id=187930 ;
_/dinegreen https://www.bu.edu/dining/sustainability/ ;
_/disc https://www.bu.edu/library/digital-ventures/ ;
_/distance https://www.bu.edu/online/ ;
Expand Down Expand Up @@ -269,6 +281,7 @@ _/execemf https://www.bu.edu/executive-courses/entrepreneurial-marketing-finance
_/executivevp https://www.bu.edu/about/admin/ ;
_/exed https://www.bu.edu/questrom/executive-education/ ;
_/experience https://www.bu.edu/meetatbu/ ;
_/experience-room https://www.bu.edu/evcon/ ;
_/expo https://www.bu.edu/xcc/about/events/experiential-learning-expo/ ;
_/ezproxy http://www.bu.edu/tech/services/cccs/remote/ezproxy ;
_/facial-rejuvenation https://www.bu.edu/dental/academics/departments/omfs/center-for-facial-rejuvenation/ ;
Expand All @@ -295,14 +308,15 @@ _/fy101 https://www.bu.edu/cas/student-life/undergraduate-students/ospl/the-firs
_/fy102 https://www.bu.edu/cas/student-life/undergraduate-students/ospl/the-first-year-experience/fy102/ ;
_/fy103 https://www.bu.edu/cas/student-life/undergraduate-students/ospl/the-first-year-experience/ ;
_/fye https://www.bu.edu/cas/student-life/undergraduate-students/ospl/the-first-year-experience/ ;
_/fys https://www.bu.edu/advising/for-students/assistant-directors-of-first-year-success/ ;
_/fys https://www.bu.edu/advising/student-populations/assistant-directors-of-first-year-success/ ;
_/gastronomy https://sites.bu.edu/gastronomy/ ;
_/gds http://bostonu.imodules.com/s/1759/2-bu/dayofService/home.aspx?sid=1759&gid=2&pgid=3328 ;
_/gegi https://www.bu.edu/pardeeschool/research/gegi/ ;
_/geochemistry https://www.bu.edu/earth/ ;
_/geology https://www.bu.edu/earth/ ;
_/geophysics https://www.bu.edu/earth/ ;
_/geoscience https://www.bu.edu/earth/ ;
_/geosciences https://www.bu.edu/earth/ ;
_/getready https://www.bu.edu/questrom/pemba/?utm_source=Boston%20Metro&utm_medium=PopUp&utm_content=GetReady&utm_campaign=PEMBA%20Because ;
_/ghi https://www.bu.edu/sph/about/departments/global-health/ ;
_/giftcalculator http://www.plan.gs/Article.do?orgId=5777&articleId=11790 ;
Expand Down Expand Up @@ -341,7 +355,14 @@ _/givetolaw https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid
_/givetosph https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid=2&pgid=497&cid=1170&appealcode=WEBSPH-PR ;
_/givetowtbu https://trusted.bu.edu/s/1759/2-bu/giving.aspx?sid=1759&gid=2&pgid=434&cid=1077&dids=141&appealcode=WEBCOM ;
_/giving https://www.bu.edu/alumni/giving/ ;
_/givingback https://www.bu.edu/alumni-forms/forms/annualfund/givingback/index.html ;
_/givingday https://givingday.bu.edu/pages/bu-giving-day-home ;
_/givingdayvip2023 https://givingday.bu.edu/pages/bu-vip/?appeal_id=63dbb13c7ce0802044a94e0f ;
_/givingdayvip2024 https://givingday.bu.edu/pages/bu-vip/?appeal_id=65bbcc7aeccd5c259c3c9ca2&utm_medium=appeal&utm_source=link&utm_campaign=print_bualumni&utm_term=give&utm_content=FY24_giving_day_letter_url ;
_/givingday/vip https://givingday.bu.edu/pages/bu-vip ;
_/givingmatters https://www.bu.edu/campaign/ways-of-giving/annual-fund/donor-impact-page/your-giving-matters/ ;
_/givingsocieties https://www.bu.edu/alumni/giving/who-gives/ ;
_/givingtuesday https://givingtuesday.bu.edu/pages/giving-tuesday-1 ;
_/global-crisis https://www.bu.edu/com/academics/journalism/crisis-reporting/ ;
_/global-parents-network https://www.bu.edu/alumni/giving/who-gives/global-parents-network/ ;
_/globaldayofservice http://bostonu.imodules.com/s/1759/2-bu/dayofService/home.aspx?sid=1759&gid=2&pgid=3328 ;
Expand All @@ -358,6 +379,7 @@ _/google/docs https://docs.google.com/a/bu.edu/ ;
_/google/drive https://docs.google.com/a/bu.edu/ ;
_/google/sites https://sites.google.com/a/bu.edu/ ;
_/googlesites https://sites.google.com/a/bu.edu/sites/system/app/pages/meta/dashboard ;
_/googlesites/admin https://www.google.com:443/a/cpanel/bu.edu/Dashboard ;
_/goterriers https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid=2&pgid=410&cid=1042&appealcode=WEBATH-PR ;
_/govcenter https://www.bu.edu/questrom/pemba/?utm_source=govcenter&utm_medium=number1eveningmba&utm_campaign=aug2012 ;
_/gpr https://www.bu.edu/religion/academics/graduate-program/ ;
Expand All @@ -378,6 +400,12 @@ _/help/wordpress https://bu.service-now.com/sp/?id=sc_category&sys_id=9498a5951b
_/helpinfo https://www.bu.edu/shs/behavioral-medicine/ ;
_/herbalstudy http://wwwapp1.bumc.bu.edu/FM_HerbalStudy/ ;
_/hi https://www.bu.edu/hic/ ;
_/hiccse https://www.bu.edu/hic ;
_/highholiday https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid=2&pgid=5749&cid=10563&dids=35&appealcode=24HILLELBUHHM&utm_medium=appeal&utm_source=link&utm_campaign=print_bualumni&utm_term=give&utm_content=24_hillel_high_holidays_vanity_url ;
_/hilleldining https://www.bu.edu/phpbin/hilleldining/ ;
_/hipart http://scv.bu.edu/HiPArt/ ;
_/hirequestrom https://www.bu.edu/questrom/careers/hire-questrom/ ;
_/histology https://www.bu.edu/phpbin/medlib/histology/ ;
_/hockeygolf https://secure-alumni.bu.edu/olc/pub/BUAR/event/showEventForm.jsp?form_id=73772 ;
_/hocvip https://trusted.bu.edu/s/1759/2-bu/19/1col.aspx?sid=1759&gid=2&pgid=13805&content_id=16021 ;
_/holickehlersdanlosfund https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid=2&pgid=422&cid=1060&dids=361&appealcode=WEBMED-DV ;
Expand All @@ -392,6 +420,7 @@ _/ice http://www.innercityentrepreneurs.org ;
_/ict https://www.bu.edu/classics/ ;
_/id https://www.bu.edu/marcom/ ;
_/ihs https://www.bu.edu/european/ ;
_/ihsip https://www.bu.edu/research/ ;
_/impact https://www.bu.edu/alumni/giving/impact/ ;
_/infancp https://www.bu.edu/infantcp/ ;
_/infocenter https://www.bu.edu/about/ ;
Expand Down Expand Up @@ -421,6 +450,9 @@ _/it https://www.bu.edu/tech/ ;
_/itcommon https://www.bu.edu/it-common/ ;
_/itrp http://www.academyofmediaproduction.com/ ;
_/jam https://questromworld.bu.edu/businesseducationjam/ ;
_/jam-now http://smgworld.bu.edu/businesseducationjam/?utm_source=chronicle&utm_medium=print%20ad&utm_content=89%25%20business%20leaders&utm_campaign=biz%20ed%20jam ;
_/jamdocs http://drive.google.com/a/bu.edu ;
_/jamsponsor http://smgworld.bu.edu/businesseducationjam/sponsorships/ ;
_/janetosprize https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid=2&pgid=412&cid=1044&dids=1080&bledit=1&appealcode=WEBAGC ;
_/jeremyyudkinscholarship https://www.bu.edu/alumni/giving/why/opportunity/ ;
_/jobs https://www.bu.edu/hr/careers/ ;
Expand All @@ -430,6 +462,7 @@ _/june30 https://trusted.bu.edu/s/1759/22/form.aspx?sid=1759&gid=2&pgid=412&cid=
_/kandarian https://www.bu.edu/sargent/profile/susan-kandarian-phd/ ;
_/kendall https://www.bu.edu/questrom/pemba/?utm_source=mbta&utm_medium=kendall&utm_campaign=mbta_kendall ;
_/kerberos https://www.bu.edu/computing/accounts/kerberos/ ;
_/kerberosonly https://www.bu.edu/computing/accounts/create ;
_/kpw https://weblogin.bu.edu/accounts/create?_hostname=ad&_conffile=kpw ;
_/kpw/printsync https://weblogin.bu.edu/accounts/create?template_extension=printsync&_hostname=ad&_conffile=printsync ;
_/kssf https://www.bu.edu/sth/alumni/giving/ ;
Expand Down Expand Up @@ -502,6 +535,7 @@ _/mbasession https://www.bu.edu/mbainfo/?utm_source=spotify&utm_medium=30%20seco
_/mbta https://www.bu.edu/questrom/pemba/?utm_source=mbta&utm_medium=MBTAads&utm_campaign=BackBayAug2012 ;
_/mdparents https://www.bumc.bu.edu/busm/parents/ ;
_/medalum https://www.bu.edu/medalumni/ ;
_/medalumni https://www.bu.edu/medalumni/ ;
_/medaw https://www.bumc.bu.edu/camed/alumni/events/schedule-of-events/ ;
_/medclassnotes https://www.bumc.bu.edu/busm/alumni/ ;
_/medenews https://www.bumc.bu.edu/busm/alumni/ ;
Expand Down Expand Up @@ -592,9 +626,13 @@ _/patientconnect https://www.bu.edu/shs/patientconnect ;
_/payment https://www.bu.edu/link/bin/uiscgi_student_account_payment_third_party.pl ;
_/paymyrent https://www.bu.edu/link/bin/uiscgi_student_account_payment_third_party.pl?ModuleName=grad_housing_payment.pl ;
_/pemba https://www.bu.edu/mbainfo/professional-evening-mba/ ;
_/pemba-essays https://www.bu.edu/questrom/admissions/graduate-programs/part-time-mba/admissions-checklist/ ;
_/pemba-part-time https://www.bu.edu/mbainfo/professional-evening-mba/ ;
_/perd https://www.bu.edu/fitrec/ ;
_/personnel https://www.bu.edu/hr/ ;
_/photo https://www.bu.edu/marcom/our-expertise/photo-video/photo/ ;
_/photo/commencement https://www.bu.edu/marcom/projects/commencement/ ;
_/photo/request https://www.bu.edu/marcom/start-a-project/ ;
_/phpbin/cashier-admin https://www.bu.edu/phpbin/marconi/reconcile/ ;
_/phpbin/change-entry https://www.bu.edu/myidentity ;
_/phpbin/directory https://www.bu.edu/directory/ ;
Expand Down Expand Up @@ -685,6 +723,7 @@ _/smgalum https://www.bu.edu/questrom/alumni/ ;
_/snl https://www.bu.edu/ise/ ;
_/software https://www.bu.edu/tech/services/cccs/desktop/distribution/ ;
_/south https://www.bu.edu/questrom/pemba/?utm_source=southstation&utm_medium=number1eveningmba&utm_campaign=aug2012 ;
_/southfloridacelebratesbu https://secure-alumni.bu.edu/olc/pub/BUAR/event/showEventForm.jsp?form_id=195821 ;
_/space http://space.bu.edu/ ;
_/speccol https://www.bu.edu/library/gotlieb-center/ ;
_/specialdonation https://trusted.bu.edu/s/1759/2-bu/giving.aspx?sid=1759&gid=2&pgid=412&cid=1044&dids=192&appealcode=WEBAGC ;
Expand Down Expand Up @@ -751,11 +790,14 @@ _/track http://www.goterriers.com/ ;
_/training http://www.example.com/ ;
_/transfer https://www.bu.edu/admissions/apply/transfer/ ;
_/travel https://www.bu.edu/travelservices/ ;
_/travelregistry https://www.bu.edu/globalprograms/manage/international-travel/international-travel-registry/ ;
_/turnitin https://www.bu.edu/tech/services/teaching/assessment/grading-support-tools/turnitin/ ;
_/tv https://www.bu.edu/met/ ;
_/uhc https://www.bu.edu/khc/ ;
_/update https://www.bu.edu/alumni/contact/update-info/ ;
_/ur https://www.bu.edu/marcom/ ;
_/ur/marketing https://www.bu.edu/omc/strategic/marketing/ ;
_/urc https://www.bu.edu/erc/ ;
_/video https://www.bu.edu/online/ ;
_/vip https://vip.bu.edu/ ;
_/vision2030bh https://trusted.bu.edu/s/1759/2-bu/19/1col.aspx?sid=1759&gid=2&pgid=12482&content_id=14500 ;
Expand All @@ -770,6 +812,7 @@ _/washintern https://www.bu.edu/abroad/programs/washington-dc-internship-program
_/webcentral https://www.bu.edu/webteam/ ;
_/webticket https://bu.service-now.com/sp?id=sc_category&sys_id=9498a5951b226490b068ed70604bcb64&catalog_id=-1&spa=1 ;
_/wellbeingproject https://www.bu.edu/studentwellbeing/ ;
_/wellbeingproject/events https://www.bu.edu/provost/wellbeingproject/wellbeing-project-events ;
_/wft24 https://trusted.bu.edu/s/1759/22/form.aspx?sid=1759&gid=2&pgid=3853&cid=7172&dids=436&appealcode=24DAMAURL&utm_medium=appeal&utm_source=link&utm_campaign=print_bualumni&utm_term=give&utm_content=WFT_vanity_url ;
_/whatsnew https://www.bu.edu/today/ ;
_/wheelock24 https://trusted.bu.edu/s/1759/2-bu/giving/interior.aspx?sid=1759&gid=2&pgid=2505&cid=4460&appealcode=24DAMAURL&utm_medium=appeal&utm_source=link&utm_campaign=print_bualumni&utm_term=give&utm_content=Wheelock_vanity_url ;
Expand Down Expand Up @@ -1018,6 +1061,7 @@ questromfixit.bu.edu https://app.limblecmms.com/#!/loc-problem/2gqpwz3514/14976
servicenow.bu.edu https://bu.service-now.com ;
smartlighting.bu.edu https://www.bu.edu/smartlighting/ ;
sph.bu.edu https://www.bu.edu/sph/ ;
sph.bu.edu/otlt http://sphweb.bumc.bu.edu/otlt ;
terrieredev.bu.edu https://bostonuniversity.sumtotal.host/ ;
today.bu.edu https://www.bu.edu/today/ ;
ultra.bu.edu https://sites.bu.edu/ocn/ ;
Expand Down
6 changes: 3 additions & 3 deletions tools/check-redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,18 @@

function replace_redirect( $key, $target ) {
$contents = file_get_contents( dirname(__DIR__) . '/maps/redirects.map' );
$contents = preg_replace( '~^' . preg_quote( $key, '~' ) . '.*$~m', $key . ' ' . $target . ' ;', $contents );
$contents = preg_replace( '~^' . preg_quote( $key, '~' ) . ' .*$~m', $key . ' ' . $target . ' ;', $contents );
file_put_contents( dirname(__DIR__) . '/maps/redirects.map', $contents );
}


function remove_redirect( $key ) {
$contents = file_get_contents( dirname(__DIR__) . '/maps/redirects.map' );
$contents = preg_replace( '~^' . preg_quote( $key, '~' ) . '.*?$.~sm', '', $contents );
$contents = preg_replace( '~^' . preg_quote( $key, '~' ) . ' .*?$.~sm', '', $contents );
file_put_contents( dirname(__DIR__) . '/maps/redirects.map', $contents );

$contents = file_get_contents( dirname(__DIR__) . '/maps/sites.map' );
$contents = preg_replace( '~^' . preg_quote( $key, '~' ) . '.*?$.~sm', '', $contents );
$contents = preg_replace( '~^' . preg_quote( $key, '~' ) . ' .*?$.~sm', '', $contents );
file_put_contents( dirname(__DIR__) . '/maps/sites.map', $contents );
}

Expand Down
Loading