0

I started a new site. In my .htaccess file I thought it would be a simple matter of taking any request that didn't explicitly have a file extension in the request and rewrite to a specific file. So, for example, if the request was:

http://whatever.com/styles.css

or

http://whatever.com/funnyCats.gif

or

http://whatever.com/index.htm

...the rewrite would not apply. However, if I had a request like:

http://whatever.com/funnyCats (anything without a '.')

... I'd reroute to a special handler file. I thought that should be a simple matter of:

RewriteEngine on

# anything without a period in it is not rewritten; got a period? done as is
RewriteRule ^/[^\.]*$ dynamicActionTimeByJerryBruckheimer.php?action=$1 [I]

However, while requests with '.' are served, as expected, dynamicActionTimeByJerryBruckheimer.php is never called when '/funnyCats', 'lolololol', or anything else is requested. I get the generic IIS 404 error.

What am I doing wrong?

  • The problem looks like you've got IIS setup in a way that special characters are not allowed. This usually happens when you request something with '%'(without having '?' before) or with '+'. Just google something like "Special characters in IIS". I'd think this is the case. – Andrew Dec 12 '13 at 01:47
  • If it was a problem with special characters, wouldn't the server throw error “400 Bad Request” (or simply “Bad Request” for some cases) instead of '404' (not found)? – Matthew Reinbold Dec 13 '13 at 05:10

0 Answers0