Reputation: 187
I am creating a Symfony application on an existing web server with classic asp pages. If domain/com/*.asp is found, it loads that page. If a URL is entered and is not found, it is passed through /app.php to be processed by a PHP routing system. I set up a URL rewrite in IIS to handle this and everything works great. However, I need to make exceptions for default.asp and index.asp. I would like IIS to check the default documents and load those before deciding the URL is a 404 and rewriting it to /app.php. I could write code in PHP to check for the file and load it, but it feels like this is something that should be handled by IIS. Is it possible?
If my explanation was not clear, here is an example:
User attempts to load https://www.website.com/thisIsAFoldername If https://www.website.com/thisIsAFoldername/default.asp exists, it should load that page. Otherwise, the URL rewrite should load https://www.website.com/app.php/thisIsAFoldername
Upvotes: 0
Views: 289
Reputation: 187
I ended up just ignoring the default document settings in IIS and writing some simple PHP to handle it. In my applications exception handler, I check if the file default.asp exists at the requested path. If so, redirect to it, otherwise, show a 404.
Upvotes: 0
Reputation: 634
I know you can double click on the rewrite rule you created, and add a condition with the "not this path" or something like that ( i can't remember the name) then add the regular expression which matches your path. I used that for assetic maybe it will work in your case
Upvotes: 0