Jonathan_S
Jonathan_S

Reputation: 61

WordPress rewrite on Windows (with IIS and ASP.NET site)

I started installing (through the Web Installer Platform) a WordPress blog on my Windows 2012 Server. On the same server I’m already running a ASP.NET MVC 4.5 website. This website has a localization module built in, that takes the culture-code of the visitor (for example ‘en’) and places this in the URLs. By the way: I need the WordPress blog to run in a subfolder, namely: /blog

So, to summarize: https://example.com/en returns successfully my ASP.NET website https://example.com/en/blog should return my WordPress blog.

Now, when I proceed configuring the WordPress site by opening https://example.com/en/blog/wp-admin/install.php, it shows me the fields for entering the site title, username + password and email. This is done on install.php?step=1.

When clicking ‘install wordpress’ it should take me to install.php?step=2. But instead of taking me to https://example.com/en/blog/wp-admin/install.php?step2, it takes me to https://example.com/en/install.php?step=2. It just removes the /blog/wp-admin/ part from the URL. This results in a 404 since this page obviously doesn’t exist.

I have not set up any rule in the web.config or IIS. Should I do this to fix this problem?

Is there anyone who can help me out there?

Upvotes: 0

Views: 288

Answers (1)

Jonathan_S
Jonathan_S

Reputation: 61

It was solved by adding "blog" in the global.asax.cs in the ExclusionFilter as follows:

i18n.UrlLocalizer.QuickUrlExclusionFilter = new System.Text.RegularExpressions.Regex(@"(?:sitemap.xml|.css|.jpg|.png|.svg|.woff|.woff2|.eot|.js|.html|.json)$|(?:blog)");

Upvotes: 1

Related Questions