Shares of technology companies rose, but not by as much as the broad market, as investors rotated into sectors that have lagged the red-hot tech industry group.

Tech giants have outperformed the broad market on sessions when overseas economic prospects looked brighter than the U.S. With a domestic boost likely from legislation, investors have rotated into sectors more closely tied to domestic economic fortune.

Online furniture seller Wayfair saw shares rally after it turned a profit for the first time since going public in 2014, breaking a string of losses, as more house-bound online shoppers bought home goods during the pandemic.

Shares of Wayfair have now more than quintupled since the March lows, even as Chief Executive Niraj Shah warned it was hard to predict whether that trend will last.

Shares of Tinder and Match owner Match Group rallied after the online-dating giant reported second-quarter earnings in excess of analyst expectations.

Write to Rob Curran at rob.curran@dowjones.com