wordpress rewritecond and rewriterule

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 4
Joined: 14 Jun 2013, 15:39

wordpress rewritecond and rewriterule

14 Jun 2013, 15:42

Anyone have a sample httpd.ini (I assume that's the filename used with this product) file I can use for wordpress? I tried a search for this but my search was too "common" so it refused. I'm sure this question gets asked over and over. Sorry about that.

Here's my current file that doesn't work quite right:

[ISAPI_Rewrite]
RewriteCond URL !^/wp-.*
RewriteRule /wp1/(.*)$ /wp1/index.php/$1 [I,L]

If I remove the RewriteCond everything is ok up to a point, bit I won't be able to login (wp-login) or do any administration.

Here is my search results. Hey great. Thanks. I love it:

Information

The following words in your search query were ignored because they are too common words: wordpress rewriterule.
You must specify at least one word to search for. Each word must consist of at least 3 characters and must not contain more than 14 characters excluding wildcards.

User avatar
Posts: 4
Joined: 14 Jun 2013, 15:39

Re: wordpress rewritecond and rewriterule

14 Jun 2013, 18:44

I don't see any way to edit my previous post. Here is more info:

[ISAPI_Rewrite]
# IIS 6

# page isn't redirecting properly if there is a wp- because the RewriteCond is incorrect
# http://www.example.com/wp1/wp-login.php
# I need to match to /wp1/wp- (the two ways I've tried are shown below)

# Line 3: Unrecognized string: RewriteCond %{HTTP_X_REWRITE_URL} !^/wp1\/wp-.*
# Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
RewriteCond %{HTTP_X_REWRITE_URL} !^/wp1/index.php/wp-.*

#RewriteCond %{HTTP_X_REWRITE_URL} !^/wp1/wp-.*

#RewriteCond %{HTTP_X_REWRITE_URL} !^/wp1\/wp-.*

RewriteRule /wp1/(.*)$ /wp1/index.php/$1 [I,L]

User avatar
Posts: 4
Joined: 14 Jun 2013, 15:39

Re: wordpress rewritecond and rewriterule

14 Jun 2013, 19:35

I've determined dotster must not be using this HeliconTech product. I have no idea what they use. They probably don't know either.

User avatar
Posts: 4
Joined: 14 Jun 2013, 15:39

Re: wordpress rewritecond and rewriterule

14 Jun 2013, 22:27

If you use dotster you may want to setup the IIS 6 httpd.ini file to look similar to this, to avoid index.php being in the URL:
Code: Select all
[ISAPI_Rewrite]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp1/wp-(.*) /wp1/wp-$1 [L]

# For normal wordpress content, via index.php
RewriteRule ^/wp1/$ /wp1/index.php [L]
RewriteRule /wp1/(.*) /wp1/index.php/$1 [L]

# Be sure to put this rule at the bottom
RewriteRule /wp1/(.*)$ /wp1/index.php/$1 [I,L]

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: wordpress rewritecond and rewriterule

17 Jun 2013, 11:03

You may also want to know that the rules you provided will work for ISAPI_Rewrite 2, not 3.
ISAPI_Rewrite 2 uses httpd.ini, while ISAPI_Rewrite 3 - httpd.conf. Also, the syntax is a little different.

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 5 guests