| 104 | ==== What if magic does not work? |
| 105 | |
| 106 | Sometimes the method to isolate static content from Trac described above does not work. The files the `htdocs` folder are ignored and the css/js files are returned through the FastCGI handler. |
| 107 | |
| 108 | If you run into this problem, try the alternative approach: |
| 109 | |
| 110 | - Instead of configuring the URL rewriting rules, create a Virtual Directory called `chrome` in the root of the website. If you already created URL rewriting rules, remove or disable them. |
| 111 | - Disable our handler for this virtual directory (through GUI or by modifying `web.config` as described below). |
| 112 | - If it returns error 401, make sure that the `IUSR` account has read permissions for the `htdocs` folder. |
| 113 | |
| 114 | To turn off our handler, find its name in the Handler Modules section of GUI and then create the following `web.config` file in the root of the `htdocs`: |
| 115 | |
| 116 | {{{ |
| 117 | <?xml version="1.0" encoding="UTF-8"?> |
| 118 | <configuration> |
| 119 | <system.webServer> |
| 120 | <handlers> |
| 121 | <!-- Use GUI to find out how exactly your FastCGI handler is called --> |
| 122 | <remove name="Python FastCGI_WSGI" /> |
| 123 | </handlers> |
| 124 | </system.webServer> |
| 125 | </configuration> |
| 126 | }}} |
| 127 | |
| 128 | If you want to re-enable the FastCGI handler for a specific subfolder of `htdocs`, you can create a similar `web.config` in this folder and instead of `<remove>` tag, insert something like this: |
| 129 | |
| 130 | {{{ |
| 131 | <add name="Python FastCGI_WSGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="[path to python]\python.exe|[path to wfastcgi.py]\wfastcgi.py" resourceType="Unspecified" /> |
| 132 | }}} |
| 133 | |
| 134 | You can also find it in the web.config of the root folder of the site. |
| 135 | |