Back to Blog

Correcting wp-admin 404 error for wordpress under IIS

August 19, 2011

By Matt Mombrea
No Comments

If you’re running WordPress on IIS and experiencing an issue where navigating to /wp-admin results in either a blank page or a 404 error, you may need an additional rule in your .htaccess file. Generally you’ll find that, assuming you’re set up properly, you can reach the admin section by appending /index.php to the URL, but who wants to do that every time?

If you’re not already up and running with Rewrites on your Windows Server, check this post on Setting up URL Rewrites for WordPress under IIS on a Windows Server.

The rule necessary tells the standard permalink rules to ignore the wp-admin directory when performing rewrites. Simply add the following condition to your .htaccess file:

RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-admin/.*)$

The full, standard .htaccess file will now look something similar to this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-admin/.*)$

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>
# END WordPress

This rule also comes in handy if you want to host some content or additional apps under the same domain that you have WordPress running on. Normally WordPress will highjack the request and you won’t be able to reach the sub-directory, but by adding addional rules to your .htaccess file you can overcome this.

To do so, add another condition for each directory you want WordPress to ignore:

RewriteCond %{REQUEST_URI} !^/(someDirectory|someDirectory/.*)$
Matt Mombrea

Matt Mombrea

Matt is a longtime entrepreneur and software engineer. He also sits on the board of Computer Science at SUNY Fredonia. Born and raised in Buffalo, Matt is passionate about building and maintaining great businesses in Buffalo. Apart from leading Cypress North, Matt architects our company’s datacenter, engineers dozens of custom applications, and directs the rest of the development team.

See Matt's Most Recent Posts

Share this post

Leave a Reply

Search our blog

Start A Project

Categories

What's next?

Well...you might like one of these

Article

8 Timely Opportunities For Compelling...

It’s that time again; time to start thinking about weaving...

Read article

Article

AdWords Ad Extensions: A Simplified...

If you're running any AdWords campaigns, chances are you're...

Read article

Article

13 Tips For Getting The Most From...

In a world of decimated brand reach, a new tool has risen...

Read article