If you want to credit to Aeroplan - you will need to ask Aeroplan for original routing credit - will most likely need to supply evidence of original booking and rebooking. You can decide if its worth the hassle for 500 miles. If you want to credit to United, it will be a lot easier, just ask for original routing credit.
A couple times when AC rebooked me on other airlines - had to go thru UA to get those AC flights credited to my Mileage Plus, and provide proof. And then, after all is done, make sure to retrocredit to Delta - most likely your ticket that United bought you was an expensive one and will earn tons of Skymiles (revenue based)