I need some .htaccess help. If the browser URL path is one of the following: http:/www.mydomain.com/path1/path2/.../final http:/www.mydomain.com/path1/path2/.../final/ http:/www.mydomain.com/final http:/www.mydomain.com/final/ I need to test if "final", the last path info, contains a period "." anywhere in it and if so, go to handler.asp. I don't care if path1, path2, path3 etc. contains a period. Also, /final may or may not contain a trailing / (as in /final/) and that is a don't care. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} (something) RewriteRule . /.handler.asp [L] Can someone tell me what (something) should be? Thanks! Added later: I don't want the rule to fire if the filename & path point to an EXISTING file on the server
@premiumscripts, I don't want the rule to fire if the filename & path point to an EXISTING file on the server (I just modified my original post to reflect that). Does your script do that?
Well, just add these two original rules you had: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -f means don't match a file -d means don't match a dir (though this one isn't really necesary obviously)
I can't get your code recommendation to work. I tried this for my .htaccess (your line is highlighted in red): RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f [COLOR="red"]RewriteRule [^\/]+\.[^\/]*/?$ HasAdot.asp[/COLOR] RewriteRule . NoDot.asp [L] Code (markup): Regardless of the URL I enter in the browser, NoDot.asp is always run. Even when I enter HasAdot.asp as the URL, NoDot.asp is always run! What am I doing wrong?