IIS 7 - Rewrite rules being read, but not applied in .htacce
4 posts
• Page 1 of 1
- wsmithrill
- Posts: 2
- Joined: 23 Jul 2012, 10:12
IIS 7 - Rewrite rules being read, but not applied in .htacce
I'm running IIS 7 with a fully registered, paid for ISAPI rewrite.
If I put my rules into the global httpd.conf they are logged and applied fine. I see the test against each rule and see the log telling me the rewrite has occurred.
If I copy those same rules to a .htaccess file, and remove them from the httpd.conf, then restart IIS I see the tests against each of them, but they each seem to fail (Or at least the rewrite never occurs).
Anyone know what I could be doing wrong? I'm modifying a site created by another person, and the site has multiple .htaccess files in different folders, with independent rules, so without doing a lot of faffing, I couldn't just merge them all into the httpd.conf and so I need to get this working. Incidentally it works on the live server fine, using the same licence details, and same configuration (afaik).
If I put my rules into the global httpd.conf they are logged and applied fine. I see the test against each rule and see the log telling me the rewrite has occurred.
If I copy those same rules to a .htaccess file, and remove them from the httpd.conf, then restart IIS I see the tests against each of them, but they each seem to fail (Or at least the rewrite never occurs).
Anyone know what I could be doing wrong? I'm modifying a site created by another person, and the site has multiple .htaccess files in different folders, with independent rules, so without doing a lot of faffing, I couldn't just merge them all into the httpd.conf and so I need to get this working. Incidentally it works on the live server fine, using the same licence details, and same configuration (afaik).
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: IIS 7 - Rewrite rules being read, but not applied in .ht
Please, provide an example of that log for testing request and .htaccess file.
Regards
Andrew
Regards
Andrew
- wsmithrill
- Posts: 2
- Joined: 23 Jul 2012, 10:12
Re: IIS 7 - Rewrite rules being read, but not applied in .ht
I've zipped up the .htaccess file with the rules in - the httpd.conf files with the same rules in and the logs from each attempt. When the .htaccess file was being used the log is considerably smaller as none of the rules seem to match. Unlike the httpd.conf, where the rules match and thus the log is much longer.
- Attachments
-
- www-dev.zip
- (5.33 KiB) Downloaded 1050 times
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: IIS 7 - Rewrite rules being read, but not applied in .ht
Peace of cake!
Take a look:
Log for httpd.conf
Log for .htaccess
the difference is in '/' in front of the incoming request. The reason for this is that in .htaccess file the 'RewriteBase /' is already enabled.
All you need to do is to remove the '/' from the beginning of the pattern.
Regards
Andrew
Take a look:
Log for httpd.conf
- Code: Select all
3) applying pattern '^/([-_a-zA-Z0-9]+)/wrong-password/?$' to uri '/fos-test'
Log for .htaccess
- Code: Select all
3) applying pattern '^/([-_a-zA-Z0-9]+)/wrong-password/?$' to uri 'fos-test'
the difference is in '/' in front of the incoming request. The reason for this is that in .htaccess file the 'RewriteBase /' is already enabled.
All you need to do is to remove the '/' from the beginning of the pattern.
Regards
Andrew
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests