• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 560
  • Last Modified:

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

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

0
Hedley Phillips
Asked:
Hedley Phillips
2 Solutions
 
meverestCommented:
Hi,

so what exactly is the problem, and which rule/s don't do what you want?

Cheers.
0
 
ahoffmannCommented:
> http://domainname.com/?page_id=85 -> http://domainname.com/history
I assume you type in the left URL in the browser and you want the server to deliver the right URL

RewriteRule ^/\?page_id=85 /history [I,O,U]
0
 
Hedley PhillipsAuthor Commented:
I managed to get an answer on another forum. The re write rule is as such:

RewriteRule /history/ /\?page_id=85 [I,L]

So the other way round.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now