How to override order/history.phtml template in Magento 2?

You can override history.phtml file using layout XML by creating a module or directly add template file to the theme level under Magento_Sales module under the theme.

History.phtml file initiated by History.php Block class.

  • Using Theme level,

app/design/frontend/<ThemePackage>/themename/Magento_Sales/templates/order/history.phtml

history.phtml file used for display list of Orders for a customer inside Customer Dashboard My Orders Section.

you can see My Orders page by URL, <SITE_URL>/sales/order/history

  • Using Module,

You need to create sales_order_history.xml file to add template,

Path:
app/code/Rbj/History/view/frontend/layout/sales_order_history.xml

Create history.phtml file,
Path:
app/code/Rbj/History/view/frontend/templates/order/history.phtml

Add Content from Sales Module history.phtml to your custom template and start modify based on your requirement.

Clear a cache and check your login page.