Strange things on my site

Topics: User Forum
Sep 28, 2006 at 4:52 PM
Hello,

I have installed the filter as instructed, used it on a website running Coldfusion 6.1, (Windows 2003 server) and it seems to stop any javascript and styleshhets from working on the site!!! Is there something I am missing???

Thanks in advance.

Vinny
Coordinator
Sep 28, 2006 at 6:49 PM
yes!
likely you have a rule which is rewriting requests for javascript (.js) and .css files, when you did not intend this.

Be sure your filter has a LogLevel of 3 or higher, then check the log files to see how it is rewriting .js and .css requests.

you should be careful to exclude .js and .css if that is what you want. you can do this with a negative lookahead in the match-pattern.

negative lookahead is ?!, so for example, try something like this:

RewriteRule (?!\.(css|js))^/whatever$ index.htm L

Oct 4, 2006 at 12:54 PM
Cheeso,

Thanks for getting back to me.

What I'm trying to do is that if someone types in:

www.cmsserver.co.uk/vinnymo

the site will keep that url in the address bar but use the following url:

www.cmsserver.co.uk/index.cfm?page=modules/artist&bandname=vinnymo

As explained, when I upload the filter the site doesn't display the javascript or css for the site.

This is my code for the ReWrite (Negative Lookaheads):

RewriteRule (?!^/index.cfm)(?!.\/$)(?!.\.html$)^/(.*)$ /index.cfmpage=modules/artist&bandname=$1

Cheers

Vinny
Oct 11, 2006 at 1:40 PM
Anybody about on this forum?
Coordinator
Oct 17, 2006 at 8:36 PM
vinny, can you explain what you are hoping to do with that latest rule you posted? In english, what are you trying to do? and can you give me some samples of URLs you would like to be rewritten (should presume these are .html URLs?) and also examples you would like to exclude via negative lookahead.

I'll try to help from there.

thanks.
Oct 23, 2006 at 4:59 PM
Cheeso,

I'm building a website for artists to post music to as well as have a profile page similar to Myspace. Each artist will have a name, for example I might call myself 'vinnymo'. To make things easier for the artists, if they want to direct people to their site, rather than get them to type:

http://www.cmsserver.co.uk/index.cfm?page=modules/artist/main.cfm&artist=166

I want them to be able to type:

www.cmsserver.co.uk/vinnymo

And take them to the exact same page.

I made an attempt to do this but the site doesn't display the javascript or css for the site. The whole site is driven by Coldfusion, therefore all pages are dynamic.

Any help would be appreciated.

Cheers

Vinny
Coordinator
Oct 26, 2006 at 11:43 PM
ok, that helps.

Now, can you do this:
- stop IIS
- start IIS
- user browser to tickle http://www.cmsserver.co.uk/vinnymo
- post the relevant sections of the IIRF log file that results.
- also post your ini file.

here's what I think:

The dynamically generated page from your index.cfm module is referencing .js and .css in the html content. This causes the browser to request those things in additional requests sent to the server. I don't know what those URLs look like , but what I suspect is, your rewrite rule is catching them, and... rewriting them to something invalid.

This is why I suggested, earlier, to exclude .js and .css from your rule. I am not sure your rule is doing that. I don't see any .js or .css in your rule?

Part of the problem is this forum system is interpreting the RewriteRule syntax as markup instructions, and is inserting links and whatnot, where it should just be keeping it as plain text. That is a separate problem. . .

-Cheeso
Nov 13, 2006 at 3:02 PM
Cheeseo,

I'll do this and get back to you ASAP.

Cheers

Vinny