This method works fine in SharePoint 2013 but as of this month (august 2015) this method no longer works in new SharePoint Online environments (and group environments). When you try to upload a *.aspx file to a document library you’ll get the following warning:
There are however still ways to achieve this. You can still add *.aspx pages in the style library or use SharePoint Designer to add a file to the root of the site. This is not something a typical user would have access to, but it can be done by the site administrator/designer/owner.