Can I use ISAPI Rewrite [www.isapirewrite.com]?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

Hi,

My hosting providing has ISAPI Rewrite [www.isapirewrite.com] installed on their Windows server.  I've been trying for hours and hours to get a cleaner URL rewrite rule to work.

Is anyone out there using ISAPIRewrite, CMSMS, on a Windows Server?

Here is my httpd.ini file:
___
[ISAPI_Rewrite]

RewriteCond Host: (.+\.)?domainname\.ca
RewriteRule \.php/(\d+) /index.php\?page=$1 [I,L]
____

CMSMS seem to ignore the Rewrite Rules ??? ???  But maybe my syntax is incorrect as well ??? ???

Any help would be great :P
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by Ted »

Try using something like .shtml instead of .php to start.  mod_rewrite for apache does some neat tricks to allow this to work.  ISAPIRewrite might not be as tricky.  :)
GwynPerry

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by GwynPerry »

I just registered to ask the same question, before I found your post.

I just migrated here from wordpress. I was led to believe that WP could do what I wanted (ie: make a website, not a blog). Suffice to say that the hoops I had to jump through were more than my time is worth. While I was flapping around wondering what to do next, I picked up a new client who needed a website with a CMS that they could cope with themselves, and I stumbled across CMSMS. Absolutely love it.

Anyway, enough rambling. One of the biggest hurdles I managed to surpass with WP was the use of ISAPI_rewrite for permalinks. I have very annoying IIS hosting, which causes problems aplenty with open source software.

Perhaps we can work together to get ISAPI_rewrite working for the unfortunate IIS CMSMS users?

Here is the httpd.ini that I used for wordpress:

Code: Select all

[ISAPI_Rewrite]
# Rules to ensure that normal content gets through
RewriteRule /images/(.*) /images/$1 [L]
RewriteRule /favicon.ico /favicon.ico [L]

# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]

# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
I can't remember exactly where I picked these rules up from, but I have a big bunch of bookmarks on the subject if you're interested.
Hope this can be of some help.
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

Thanks,

I'll play around with those rules and see what we can get going.

I also raised a ticket with my hosting company.  It went up to 2nd level.  They have it installed on all of their web servers, but were unaware of a solution off hand.  The tech was looking into this further over the weekend in hopes to find a solution [great support they have!].

So maybe we can find something that works.

Thanks,
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

Ya GwynPerry,

If you want to pass along those bookmarks that would be great.  I tried a bunch of things with the rules you mentioned to no avail.

:P
GwynPerry

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by GwynPerry »

wms,
The first thing I can see that may be screwy with your rules is that you are rewriting URLs with .php files:

Code: Select all

RewriteRule \.php/(\d+) /index.php\?page=$1 [I,L]
What you need to do is rewrite from the CMSMS clean URL structure (*pagetitle*.html) to the actual CMSMS url (index.php?page=*pagetitle*).

First, make sure you have clean URLs enable in the config.php. Then, check the ISAPI_rewrite is actually working. Make a very specific rule, for example:

Code: Select all

RewriteRule /home.html /index.php\?page=home [I,L]
Adapt this to fit your site, then try it out in your browser. I can't test anything out right now, so I'm not going to be much more help. Just make sure it actually works at all, before wasting time trying to make it work for the whole site.

Here are some of those bookmarks, bear in mind they are WP centric:
http://www.basilv.com/psd/blog/2006/run ... under-iis/
http://www.selbmag.co.uk/2005/10/wordpr ... i_rewrite/
http://cornwall.backtalk.com/examples/h ... ample.php/
http://www.helicontech.com/forum/forum_ ... -2604.asp/

I'll be getting on this properly when I've finished my current projects, probably later this week.
Last edited by GwynPerry on Mon Feb 27, 2006 2:51 pm, edited 1 time in total.
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

Hi,

I changed this line in my config.php file:
$config['assume_mod_rewrite'] = true;  (from false)

And now all my menu items point to 'somepage.html' which gives me a 'page not found'.

Hmmmm...interesting.....still pounding away at it.... :P
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

Thanks Patricia for the quick reply [people are so nice here],

It's ".html", but I still get a page not found error because http://www.domainname.ca/About_Us.html doesn't exist???
LeisureLarry

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by LeisureLarry »

You shouldn´t use spaces in alias names for easier testing.
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

Thanks...it's actually "About_Us"....underscore.

I guess the underline makes it look like that ::)
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

This is what my hosting company came back with for why my isapi rewrites are not working:
_____
PHP is a funny thing. Without going into a lot of detail (hardly any, in fact) there's basically two ways to get data from formpage1 to formpage2. There's GET and POST.

You can use the GET on the formpage2 to gather all the data from the formpage1 but that's bad. This is how your CMS is doing it. What it does is submit the form data and toss all the values to the second page through the URL bar at the top. That's all the junk to the right of the ? after the blah.php.  Like..

http://www.stuff.com/formpage1.php?name=bill&stuff=Junk

The biggest reason that's bad is because if it's going into another form or database, people can grab that generated URL and insert *NEW* values and *EXTRA* values which can really mess up your stuff. The CMS you're using isn't trying to mess anything up. That's just how it works. I'm only pointing out a potential exploit. Then again, exploits are everywhere.

Post is the other way of doing this. When you log into a Web site, quite often you're using sessions. This keeps the values out of the URL bar and is a lot more secure. Thus, the URL looks, as you say (and as I agree), cleaner.

To make your CMS do this, you would have to change all the code that handles the form submissions to use the other kind of submit funtion. Get -> Post. Not fun. Not easy.  Not quick.
_____

Yeah...now that just confused me.... :-[
LeisureLarry

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by LeisureLarry »

That is nonsense and has nothing to do with your problem.
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

You think ;D

Yeah...didn't help much....they're usually pretty good...but that answer was quite off the wall.  And I have no idea what I'm talking about.
wms
Forum Members
Forum Members
Posts: 204
Joined: Mon Feb 13, 2006 7:26 pm

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by wms »

So,

RewriteRule /([^/]+)\.html /index.php\?page=$1 [I,L]

works if I manually type in http://www.domainname.ca/Home.html (or whatever page equals).

I guess I'm was just confused, misguided, no - confused. ::)

I thought everytime I select a link from the menu [on my website], the page will just look like http://www.domainname.ca/Home.html even though my URL in my menu says it's http://www.domainname.ca/index.php?page=Home. I thought that's how isapi rewrite worked.

Now I just have to figure out how to change the menu URLs.  Which I don't think is possilbe because it's just generated automatically.  Is that correct...anyone...anyone.  Can you change the URLs for the menu ???

Wow...3 days to come to this realization....I wasn't kidding everyone when I said I was really confused ;D

Thanks for all of your help,
LeisureLarry

Re: Can I use ISAPI Rewrite [www.isapirewrite.com]?

Post by LeisureLarry »

wms wrote: Hi,

I changed this line in my config.php file:
$config['assume_mod_rewrite'] = true;  (from false)

And now all my menu items point to 'somepage.html' which gives me a 'page not found'.

Hmmmm...interesting.....still pounding away at it.... :P
Do this again :D
Post Reply

Return to “CMSMS Core”