| Author |
|
jacob santos Newbie

Joined: 21 August 2008 Location: United States
Online Status: Offline Posts: 3
|
| Posted: 21 August 2008 at 3:39pm | IP Logged
|
|
|
The problem with the debugging is that it doesn't show what the "-f" and "!-f" is being matched, it just shows a blank string.
Code:
| RewriteCond: input='C:/PATH/TO/index.html' pattern='' => matched |
|
|
The problem is that it is matching something that has "!-f", which the file does exist. This is against the specification. Also "-f" does not match against files that exist, which leads me to believe that the implementation is poorly done, since it works in mod_rewrite.
Code:
RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^(.*)$ $1 [L]
RewriteCond %{HTTP_HOST} ^bransontourismcenter\.com [NC] RewriteRule ^(.*)$ http://www.bransontourismcenter.com$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/index.htm$ [OR] RewriteCond %{REQUEST_URI} ^/index.php$ RewriteRule ^(.*)$ /index.html [R=301, L]
RewriteCond %{REQUEST_URI} ^/?upcomingbransonevents.htm$ RewriteRule ^(.*)$ http://www.bransontourismcenter.com/events/ [R=301]
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} \.htm(l?)$ RewriteRule ^(.*)\.htm(l?)$ $1.php [QSA, NC]
|
|
|
The file index.html is expected to match against
Code:
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ $1 [L]
|
|
|
But is matching against
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} \.htm(l?)$
RewriteRule ^(.*)\.htm(l?)$ $1.php [QSA, NC]
|
|
|
Which leads to a 404 error since it is rewriting the index.html (which does exist) to index.php (which does not exist).
These rules have been confirmed to work correctly.
Code:
RewriteCond %{HTTP_HOST} ^bransontourismcenter\.com [NC]
RewriteRule ^(.*)$ http://www.bransontourismcenter.com$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/index.htm$ [OR]
RewriteCond %{REQUEST_URI} ^/index.php$
RewriteRule ^(.*)$ /index.html [R=301, L]
RewriteCond %{REQUEST_URI} ^/?upcomingbransonevents.htm$
RewriteRule ^(.*)$ http://www.bransontourismcenter.com/events/ [R=301]
|
|
|
However they only work with the omission of "-f".
I'm currently using the trial Pro version and I'm not going to buy this until these rules work. If they can work, then I'll be buying the ISAPI module. However, I mean, this should work in the free version also, but it doesn't.
IIS 6 + Windows 2003 using ISAPI_Rewrite 3 Trial version.
|
| Back to Top |
|
| |
jacob santos Newbie

Joined: 21 August 2008 Location: United States
Online Status: Offline Posts: 3
|
| Posted: 21 August 2008 at 3:42pm | IP Logged
|
|
|
rewrite.log:
Code:
init rewrite engine with requested uri /index.html (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf (3) applying pattern '^(.*)$' to uri 'index.html' (4) RewriteCond: input='C:/Inetpub/vhosts/bransontourismcenter.com/httpdocs/index.html' pattern='' => not-matched (3) applying pattern '^(.*)$' to uri 'index.html' (4) RewriteCond: input='www.bransontourismcenter.com' pattern='^bransontourismcenter\.com' => not-matched (3) applying pattern '^(.*)$' to uri 'index.html' (4) RewriteCond: input='/index.html' pattern='^/index.htm$' => not-matched (4) RewriteCond: input='/index.html' pattern='^/index.php$' => not-matched (3) applying pattern '^(.*)$' to uri 'index.html' (4) RewriteCond: input='/index.html' pattern='^/?upcomingbransonevents.htm$' => not-matched (3) applying pattern '^(.*)\.htm(l?)$' to uri 'index.html' (4) RewriteCond: input='C:/Inetpub/vhosts/bransontourismcenter.com/httpdocs/index.html' pattern='' => matched (4) RewriteCond: input='/index.html' pattern='\.htm(l?)$' => matched (1) escaping /index.php (1) Rewrite URL to >> /index.php (2) rewrite 'index.html' -> '/index.php' (2) internal redirect with /index.php [INTERNAL REDIRECT]
|
|
|
Is there a way to have the rewrite log not log the IP address?
|
| Back to Top |
|
| |
Anton Moderator Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 5225
|
| Posted: 22 August 2008 at 7:28am | IP Logged
|
|
|
Please tell what version of ISAPI_Rewrite are you using. And please send to support@helicontech.com your complete config and rewrite log.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 688
|
| Posted: 26 August 2008 at 8:42am | IP Logged
|
|
|
Hi Jacob.
Please try these rules:
Code:
RewriteBase /
RewriteCond %{HTTP_HOST} ^bransontourismcenter\.com [NC]
RewriteRule ^(.*)$ http://www.bransontourismcenter.com/$1 [R=301,L]
RewriteRule ^index\.(?:htm|php)$ index.html [R=301,L]
RewriteRule ^upcomingbransonevents\.htm$ http://www.bransontourismcenter.com/events/ [R=301]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? $1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(?!index)(\w+)\.html?$ $1.php [NC,L]
|
|
|
__________________ Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
|
| Back to Top |
|
| |
jacob santos Newbie

Joined: 21 August 2008 Location: United States
Online Status: Offline Posts: 3
|
| Posted: 26 August 2008 at 1:49pm | IP Logged
|
|
|
Last rule didn't fix the issue.
I should add that I am using Plesk, but have removed urlprotect from the domain.
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 688
|
| Posted: 27 August 2008 at 5:11am | IP Logged
|
|
|
Please provide your rewrite.log using my rules. Also please tell your version of ISAPI_Rewrite.
You can send all information with confidential data to support@helicontech.com
__________________ Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
|
| Back to Top |
|
| |
Vyacheslav Moderator Group

Joined: 02 July 2008 Location: Ukraine
Online Status: Offline Posts: 688
|
| Posted: 27 August 2008 at 5:36am | IP Logged
|
|
|
Jacob, I have received your letter and have answered on it. Please check your email.
__________________ Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
|
| Back to Top |
|
| |