Table of Contents
Situation
Source Version: ASP.NET 4.0
WordPress marketshare has been dramatically increased in recently years. More and more people use WordPress for bloggin or e-commerce applications, and also moving existing site to WordPress to reduce maintenance and SEO cost in the future.
Due to ASP.NET and Wordpress are totally different in technology, so converting between them directly is imposible.
First try to setup a theme to accommadate the common parts, e.g. header, menu, and footer. Finally I found that it is not easy to find a suitable theme to do this task, and the page contents would be controlled by different set of stylesheet. Give up!
Then try second method - the final approach.
Key Points
Dynamic Resources
ASP.NET page contains special hidden dynamic contents:
WebResource.axd and ScriptResource.axd files. These are stylesheet and javascripts files that the page rely on during rendering.
Common Areas
With php we can include files that contains common contents, like header, menu, footer, sidebar.
include_once("./includes/header.php"); include_once("./includes/menu.php"); include_once("./includes/footer.php");
Steps
- Copy the folders that contains static resources to the destination.
- Open each page source code from browser: right click > view page source. Save the page source to local, name it with php extension.
- Open WebResource.axd and ScriptResource.axd links from source view, then save them to local. Rename and move to coresponding resouce folders of destination server.
- Change resource links on page source, remember to change the path based on step 3.
- Extract common contents and save to separate files with php extension.
- Replace and include the common contents on each page from the files in step 5.
- done.
Sites applied
Comments