Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-13 20:43:18

spaceace
New Member
Registered: 2005-10-17
Posts: 4

Clean URLs/IIS/ISAPI Rewrite - is there a solution?

Apologies if this subject has been covered however most of the forum posts seem old or incomplete…
I have TXP installed on IIS6 with MySQL 4.1, PHP 5 and also have ISAPI Rewrite (from Helicon) available.

All is peachy with the obvious exception of Clean URLs.

Has anybody managed to find a definitive solution using ISAPI Rewrite to enable the use of clean URLs on this configuration?

Any pointers appreciated…

Thanks

Offline

#2 2005-12-13 21:42:40

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: Clean URLs/IIS/ISAPI Rewrite - is there a solution?

I’m afraid that I can’t offer any solutions, but it’s worth pointing something out in the <a href=“http://textpattern.com/faq/119/what-are-the-system-requirements”>system requirements FAQ</a>:

<blockquote>Textpattern probably works on any web server that supports PHP. It is reported to work well on IIS and Lighttpd. Clean URLs are possible on those systems, with the right configuration, but are not officially supported.</blockquote>

Which is not to say that someone here won’t help. But it’s something to keep in mind.

Offline

#3 2005-12-13 21:47:57

spaceace
New Member
Registered: 2005-10-17
Posts: 4

Re: Clean URLs/IIS/ISAPI Rewrite - is there a solution?

Yep – noted that at install. But various forum posts seem to indicate people have made some progress in getting a result so figured it was worth asking once more… :-)

Offline

#4 2005-12-13 21:54:18

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Clean URLs/IIS/ISAPI Rewrite - is there a solution?

IIS users appear to be either nonexistent, or uninterested in helping.


Alex

Offline

#5 2006-01-12 23:31:49

skoggy
Member
From: Westcoast of Sweden
Registered: 2005-03-27
Posts: 209
Website

Re: Clean URLs/IIS/ISAPI Rewrite - is there a solution?

As you may have seen lately I´m a very interested and indeed existent IIS user… but sadly not very skillful. Tried everything written on this forum, and I thought for 1,5 day that I/you/we had it…

Offline

#6 2006-01-13 03:56:30

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Clean URLs/IIS/ISAPI Rewrite - is there a solution?

Ok, you have a captive audience of three Textpattern developers who don’t use or have access to IIS, and know nothing much about it.


Alex

Offline

#7 2006-01-13 10:43:56

PeterJLambert
New Member
Registered: 2004-12-22
Posts: 6

Re: Clean URLs/IIS/ISAPI Rewrite - is there a solution?

I’ve managed to get it working to a degree on http://fastline-uk.com using ISAPI Rewrite. I have very little knowledge of RegExp and had to bodge a bit of a solution together. With a bit more knowledge/work I’m sure you could get it working properly.

At present only some of this seems to work. Sections are clean. Categories are not so clean.

I’ve had to create a set of rules for each section I’ve got – although I’m sure this could be made a bit more universal.

Here’s the contents of the httpd.ini file:

<pre>
<code> [ISAPI_Rewrite]

# Defend your computer from some worm attacks RewriteRule .. . [F,I,O]

# 3 Rewrite Rules for each section: # Rule for page permalinks # Rule for section homepages (matches category) # Rule for categories within sections

RewriteRule /products/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /products(/*)$ /index.php\?s=products&c=products RewriteRule /products/\?c=(.*) /index.php\?s=products\&c=$1

RewriteRule /otm/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /otm(/*)$ /index.php\?s=otm&c=OTM RewriteRule /otm/\?c=(.*) /index.php\?s=otm\&c=$1

RewriteRule /freight/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /freight(/*)$ /index.php\?s=freight&c=freight RewriteRule /freight/\?c=(.*) /index.php\?s=freight\&c=$1

RewriteRule /small-plant/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /small-plant(/*)$ /index.php\?s=small-plant&c=small-plant RewriteRule /small-plant/\?c=(.*) /index.php\?s=small-plant\&c=$1

RewriteRule /transport/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /transport(/*)$ /index.php\?s=transport&c=transport RewriteRule /transport/\?c=(.*) /index.php\?s=transport\&c=$1

RewriteRule /specialist-plant/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /specialist-plant(/*)$ /index.php\?s=specialist-plant&c=specialist-plant RewriteRule /specialist-plant/\?c=(.*) /index.php\?s=specialist-plant\&c=$1

RewriteRule /accreditation/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /accreditation(/*)$ /index.php\?s=accreditation&c=accreditation RewriteRule /accreditation/\?c=(.*) /index.php\?s=accreditation\&c=$1

RewriteRule /contact-us/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /contact-us(/*)$ /index.php\?s=contact-us&c=contact-us RewriteRule /contact-us/\?c=(.*) /index.php\?s=contact-us\&c=$1

RewriteRule /find-us/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /find-us(/*)$ /index.php\?s=find-us&c=find-us RewriteRule /find-us/\?c=(.*) /index.php\?s=find-us\&c=$1

RewriteRule /news/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /news(/*)$ /index.php\?s=news&c=news RewriteRule /news/\?c=(.*) /index.php\?s=news\&c=$1

RewriteRule /recruitment/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /recruitment(/*)$ /index.php\?s=recruitment&c=recruitment RewriteRule /recruitment/\?c=(.*) /index.php\?s=recruitment\&c=$1

RewriteRule /search/(\d+)/(.*) /index.php\?id=$1 [I,O,U,L] RewriteRule /search(/*)$ /index.php\?s=search&c=search RewriteRule /search/\?c=(.*) /index.php\?s=search\&c=$1
</code>
</pre>

Offline

#8 2006-01-13 10:47:56

PeterJLambert
New Member
Registered: 2004-12-22
Posts: 6

Re: Clean URLs/IIS/ISAPI Rewrite - is there a solution?

Sorry, I should have explained that a bit better. The second rule in each of those sets of three is to make sure that when you go to /_sectionname_/ it actually gives you the articles from /_sectionname_/_categoryname_/ where categoryname is the same as sectionname.

This is just because of the way I’ve built the site. I’ve used a category-per-page model, so basically – the category list is the site-map.

Offline

Board footer

Powered by FluxBB