views:

23

answers:

1

Hi,

I have following rewrite rules for a website:

RewriteEngine On

# Stop reading config files
RewriteCond %{REQUEST_FILENAME} .*/web.config$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} .*/\.htaccess$ [NC]
RewriteRule ^(.+)$ - [F]

# Rewrite to url
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(/bilder_losning/|/bilder/|/gfx/|/js/|/css/|/doc/).*
RewriteRule ^(.+)$ index.cfm?smartLinkKey=%{REQUEST_URI} [L]

Now I have to exclude a script including its eventually querystrings from the above rules, so that I can access and execute it on the normal way, at the moment the whole url is being ignored and forwarded to the index page.

I need to have access to the script shoplink.cfm in the root which takes variables tduid and url (shoplink.cfm?tduid=1&url=)

I have tried to resolve it using this:

# maybe?: 
RewriteRule !(^/shoplink.cfm [QSA]

but to be honest, I have not much of a clue of urlrewriting and have no idea what I am supposed to write. I just know that above will generate a nice 500 error.

I have been looking around a lot on stackoverflow and other websites on the same subject, but all I see is people trying to exclude directories, not files. In the worst case I could add the script to a seperate directory and exclude the directory from the rewriterules, but rather not since the script should really remain in the root.

Just also tried:

RewriteRule ^/shoplink.cfm$ $0 [L]

but that didn't do anything either.

Anyone who can help me out on this subject?

Thanks in advance.

Steven Esser ColdFusion programmer

A: 

Please try to put the following line at the top of your config (after RewriteEngine on):

RewriteRule ^shoplink.cfm$ - [L]
TonyCool
Hasn't worked for me, but I am starting to wonder whether this perhaps has to do with more than just htaccess. It didn't produce an 500 error at least, but it didn't give the correct result either (as in: it still went to the index.cfm file).
Steven
Look through the Apache logs, maybe you'll find some hint there. But that seems to be beyond rule syntax.
TonyCool