We help IT Professionals succeed at work.
Get Started

Need help writing a rewrite rule please for ISAPI (mod rewrite)

629 Views
Last Modified: 2012-05-06
Hi,

I am running Wordpress 2.7 on IIS 6 and my host has installed ISAPI_rewrite by (http://www.isapirewrite.com).

I have followed all the links on the Wordpress Blog (http://codex.wordpress.org/Using_Permalinks#Permalinks_without_mod_rewrite) and unfortuantely because I don't have access to php.ini I can't follow that fix so what I have done is added the following lines to a httpd.ini file (see code).


This works fine for posts with the following structure:

http://domainname.com/?p=123

and it will rewrite it to the friendly permalink name.

But, pages have the following structure:

http://domainname.com/?page_id=85

and don't rewrite and the permalink gives me a 404

Please please, can somebody provide me with the rewrite rule that I need to have permalinks with pages. I don't mind if I have to have individual rules for each page as I am only going to have 3 or 4 pages ie:

http://domainname.com/?page_id=85 -> http://domainname.com/history
http://domainname.com/?page_id=86 -> http://domainname.com/data

I have posted this on the Helicon and Wordpress forums and had no reponses so I am turning to my old favourite EE before continuing to tear my hair out.

thanks.
[ISAPI_Rewrite]
RewriteRule /([0-9]{4})/([0-9]{1,2})/ /index.php\?year=$1&monthnum=$2 [I,U,O]
RewriteRule /([0-9]{4})/([0-9]{1,2})/(.*)/(feed|rdf|rss|rss2|atom|rss2_comments)/?$ /index.php\?feed=$4&name=$3 [I,U,O]
RewriteRule /([0-9]{4})/([0-9]{1,2})/(.*)/trackback/?$ /wp-trackback.php\?year=$1&monthnum=$2&name=$3 [I,U,O]
RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom|rss2_comments)/?$ /index.php\?category_name=$1&feed=$2 [I,U,O]
RewriteRule /category/(.*) /index.php\?category_name=$1 [I,U,O]
RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom|rss2_comments)/?$ /index.php\?author_name=$1&feed=$2 [I,U,O]
RewriteRule /author/?(.*) /index.php\?author_name=$1 [I,U,O]
RewriteRule /([0-9]{4})/([0-9]{1,2})/?(.*) /index.php\?name=$3 [I,U,O]
RewriteRule /feed/(.*) /wp-rss2.php [I,U,O]
RewriteRule /comments/feed/(.*) /wp-commentsrss2.php [I,U,O]

Open in new window

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 2 Answers and 3 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE