views:

189

answers:

1

Hi there

Im am trying to use the isapi rewrite tool on my web domain to write some basic rules, but am getting a bit confused.

My base url is http://forevr-dev.co.uk/musicexplained/index.cfm and every page on the site follows from this base url. For example http://forevr-dev.co.uk/musicexplained/index.cfm/artist/blondie would be the artist page for blondie..

What I am looking for, is a rewrite rule, that would remove the index.cfm from the url, instead leaving http://forevr-dev.co.uk/musicexplained/artist/blondie.

I have put the httpd.ini file in my musicexplained folder, under the root of my forevr-dev.co.uk domain, and I am using the following code below, which I used from the coldbox coldfusion framework application examples.

RewriteEngine On
RepeatLimit 0

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.cfm/%{REQUEST_URI} [QSA,L]

However, when I now go to the new pretty url, I am recieving an error message saying that the page cannot be found, alongside a 404 message.

Any ideas?

Thanks

A: 

The thing is that you are talking about httpd.ini file (which is used in ISAPI_Rewrite v2) and the syntax above is for v3. So your version matters...

For v2 please try:

[ISAPI_Rewrite]
RewriteRule ^/(?!index\.cfm.*)(.*)$ index.cfm/$1 [I,L]

For v3 please try:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .? index.cfm/%{REQUEST_URI} [QSA,L]
TonyCool