Moving Existing Wordpress Blog on Linux to Windows Hosting

by jasonvonruden 18. April 2010 12:20

 

After purchasing new windows web hosting for several new ASP.NET websites. I decided to also transferring my existing Fantastic Freeware Wordpress Blog that was hosted on the Linux Platform onto my new Windows based Hosting.  My preferred option was to convert the Wordpress blog to BlogEngine.NETusing BlogML XML format, but I ran into a lot of conversion issues. (See below)

The Bottom Line

In the end decided to move Fantastic Freeware Wordpress blog as is from Linux hosting to Windows Hosting with 404 redirect, because the default hosting company’s 404 redirect is prevents url rewriting from working.

Options

Problems

  • The WordPress BlogML Export 1.0a for BlogML 2.0 is creating a BlogML XML file that is not compatible with the BlogEngine.NET import process which must be using BlogML 2.1Now it looks like I am going to have to dive into the source code and the XML. 
  • The RSS import was not an option because the blog has over 3000 entries and Search Engine Optimization (SEO) principles the URL must remain the same after the conversion.
  • The default hosting company’s 404 redirect was preventing url rewriting from working.

Tags: ,

ASP.NET | Wordpress

Wordpress Blog on Windows Hosting using Managed Fusion URL Rewriter

by jasonvonruden 18. April 2010 12:13

The free Managed Fusion URL Rewriteris one of the easiest url rewriters to setup and configure for use with a WordpressBlog or for your general URL Rewriting Needs.

What is Managed Fusion URL Rewriter

Managed Fusion URL Rewriter is a powerful URL manipulation engine based on the Apache mod_rewrite extension. It is designed, from the ground up to bring all the features of Apache mod_rewrite to IIS 6.0 and IIS 7.0. Managed Fusion Url Rewriter works with ASP.NET on Microsoft's Internet Information Server (IIS) 6.0 and Mono XPS Server and is fully supported, for all languages, in IIS 7.0, including ASP.NET and PHP. Managed Fusion Url Rewriter gives you the freedom to go beyond the standard URL schemes and develop your own scheme.

Warning:

If your hosing provider has a default 404 redirect that overrides if a file is not found,  then URL Rewriting will not work, because the url rewrite engine will never see the request.  Please refer to my other blog post about The Easy Way to Setup Wordpress on Windows Hosting with Permalinks

How to Setup Managed Fusion URL Rewriter for Wordpress

  1. Follow the Managed Fusion URL Rewriter setup instructions.
  2. Configure the contents of the ManagedFusion.Rewriter.txt file. (See Below)
  3. Configure the contents of the web.config. (See Below)

ManagedFusion.Rewriter.txt

RewriteEngine On
 
RewriteBase /
 
# wordpress admin folder rewrite rules
RewriteCond %{REQUEST_URI} ^wp-admin/
RewriteRule ^wp-admin/(.*) . /wp-admin/$1 [C]
 
# wordpress includes folder rewrite rules
RewriteCond %{REQUEST_URI} ^wp-includes/
RewriteRule ^wp-includes/(.*) . /wp-includes/$1 [C]
 
# wordpress general rewrite rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) /index.php [L]

web.config

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
        <section name="managedFusion.rewriter" type="ManagedFusion.Rewriter.Configuration.ManagedFusionRewriterSectionGroup"/>
    </configSections>
    <appSettings/>
    <connectionStrings/>
    
    <managedFusion.rewriter xmlns="http://managedfusion.com/xsd/managedFusion/rewriter">
        <rules engine="Apache" />
    </managedFusion.rewriter>
    
    <system.web>
        <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>
        <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
        <authentication mode="Windows"/>
        <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.
           <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>         
        -->
 
        <customErrors mode="Off">
        </customErrors>
 
        <pages>
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </controls>
        </pages>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="RewriterModule" type="ManagedFusion.Rewriter.RewriterModule, ManagedFusion.Rewriter"/>           
        </httpModules>
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="OptionInfer" value="true"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
        </compilers>
    </system.codedom>
    <!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

Tags:

Wordpress

The Easy Way to Setup Wordpress on Windows Hosting with Permalinks

by jasonvonruden 18. April 2010 12:11

If you search for how to setup a Wordpress blog using permalinks on windows hosting you will find a lot of hits referring to url rewriting which is very complex and confusing.

In the end going down the url rewriting path is a waste of time especially if you hosting company has a custom 404 redirect in place.

If you are still interested in url rewriting, please see my other blog entry about setting up a Wordpress Blog on Windows Hosting using Managed Fusion URL Rewriter

How-To Get Wordpress Permalinks working on Windows Hosting: 

  1. Install and configure Wordpress as you normally would, including your permalink settings.
  2. To get permalinks to work correctly with no url rewriting needed, change in the hosting control panel the 404 redirect to point Wordpress’s index.php.

That’s It!

Tags: , ,

ASP.NET | Wordpress

BlogEngine.NET Setup and Customization Adventures

by jasonvonruden 12. April 2010 20:46

The main reason that I picked BlogEngine.NET as the blog software for this website is because it is lightweight and easy to use.  I also found it is easy to customize the master page and CSS template to fit my needs.  The website was going to be a development blog so the Windows Live Writer and code snippet plug-in was a requirement.  I am planning to use the BlogML which is an open format derived from XML to store and restore the content of a blog to convert my Fantastic Freeware website from a Wordpress blog to BlogEngine.NET blog. 

 Customizations

What Did Not Worked

  • Converting ASP.NET Website into ASP.NET Web Application. It worked, but extensions feature no longer works, Dropped it because, it had no practical benefit.
  • Wordpress to Blogengine.NET conversion issues.  The WordPress BlogML Export 1.0a for BlogML 2.0 is creating a BlogML XML file that is not compatible with the BlogEngine.NET import process which must be using BlogML 2.1Now it looks like I am going to have to dive into the source code and the XML. (More on this in a future Post)

 

What Still Does Not Work

  • Resolved:  Windows Live Writer Issue: No spell checking (Firefox) - (Editor brakes Firefox's spell check feature) 

Tags: , ,

c# | General | Wordpress | ASP.NET