Rewrite not woking on IIS7.5
6 posts
• Page 1 of 1
Rewrite not woking on IIS7.5
I've installed Helicon Ape using MSI installed (for all sites). However rewriter does not seem to work at all.
Any url i try i get 404 error. Rewrite is configured to forbid access to everything (see configs below)
I've tried enabling logging - nothing is logs.
Please help!
Here are the details:
- OS: Windows Server 2008 R2
- Helicon Ape version: 3.1.0.256
- it's registered
- website app domain settings: Integrated mode, .NET 4.0
- https.conf (i've removed most commented out lines):
- .htaccess in the website director:
Any url i try i get 404 error. Rewrite is configured to forbid access to everything (see configs below)
I've tried enabling logging - nothing is logs.
Please help!
Here are the details:
- OS: Windows Server 2008 R2
- Helicon Ape version: 3.1.0.256
- it's registered
- website app domain settings: Integrated mode, .NET 4.0
- https.conf (i've removed most commented out lines):
- Code: Select all
# Helicon Ape version 3.1.0.256
Include licenses.conf
Loglevel debug
ErrorLog error.log
Options All -StopOnError
LoadModule rewrite_module modules/mod_rewrite.so
RewriteLog rewrite.log
RewriteLogLevel 9
- .htaccess in the website director:
- Code: Select all
RewriteEngine On
RewriteRule . - [F]
[code]
- web config:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<caching enabled="false" enableKernelCache="false" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
</configuration>
Re: Rewrite not woking on IIS7.5
I got it working after running this command:
- Code: Select all
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
Re: Rewrite not woking on IIS7.5
Ok, having other problems.
I had two rules:
When i try accessing login.html the rewriter seems to be going into a loop redirecting from login.asp to login.html and back.
This setup used to work on a previous setup (i don't know the version of Ape that was running)
Here are bits from redirect.log:
My live .htaccess file has this:
And these give an error in error.log:
How can i make the 2 above rules work? I want html files to be rewritten to asp file, but if opening asp files directly i want the user to be redirected to html file. Please help
I had two rules:
- Code: Select all
RewriteRule ^/Login\.html$ /login.asp [NC,L]
RewriteRule ^/login\.asp$ /Login.html [NC,R=301]
When i try accessing login.html the rewriter seems to be going into a loop redirecting from login.asp to login.html and back.
This setup used to work on a previous setup (i don't know the version of Ape that was running)
Here are bits from redirect.log:
- Code: Select all
40.126.250.71 40.126.250.71 [18/Jan/2017:03:01:37] [x.com/sid#2][rid#19903772/initial] (3) [perdir c:\clc\www\] applying pattern '^/Login\.html$' to uri '/Login.html' -> '/login.asp'
...
40.126.250.71 40.126.250.71 [18/Jan/2017:03:01:09] [x.com/sid#2][rid#49327843/initial/1] (2) [perdir c:\clc\www\] forcing responsecode 301 for http://x.com/Login.html
40.126.250.71 40.126.250.71 [18/Jan/2017:03:01:09] [x.com/sid#2][rid#49327843/initial/1] (3) [perdir c:\clc\www\] applying pattern '^/login\.asp$' to uri '/login.asp' -> 'http://x.com/Login.html'
My live .htaccess file has this:
- Code: Select all
RewriteCompatibility2 On
RepeatLimit 200
And these give an error in error.log:
- Code: Select all
[2017-01-18 03:52:32.213] [ConfigLoader:2] (error) [/Contact.html] c:\clc\www\.htaccess(7): Invalid command 'RewriteCompatibility2 On' on line 7, perhaps misspelled or defined by a module not included in the server configuration
[2017-01-18 03:52:32.214] [ConfigLoader:2] (error) [/Contact.html] c:\clc\www\.htaccess(8): Invalid command 'RepeatLimit 200' on line 8, perhaps misspelled or defined by a module not included in the server configuration
How can i make the 2 above rules work? I want html files to be rewritten to asp file, but if opening asp files directly i want the user to be redirected to html file. Please help
Re: Rewrite not woking on IIS7.5
Hello.
Concerning your rewrite rules - change rules order:
RewriteRule ^login\.asp$ /Login.html [NC,NS,R=301]
RewriteRule ^Login\.html$ /login.asp [NC,L]
Next, the "RewriteCompatibility2 On" directive is not supported in Ape. This directive was needed for ISAPI_Rewrite 3 to simplify the transition from ISAPI_Rewrite 2 format rules. ISAPI_Rewrite version 2 has long been discontinued and new products like Ape does not support its rule format.
Concerning your rewrite rules - change rules order:
RewriteRule ^login\.asp$ /Login.html [NC,NS,R=301]
RewriteRule ^Login\.html$ /login.asp [NC,L]
Next, the "RewriteCompatibility2 On" directive is not supported in Ape. This directive was needed for ISAPI_Rewrite 3 to simplify the transition from ISAPI_Rewrite 2 format rules. ISAPI_Rewrite version 2 has long been discontinued and new products like Ape does not support its rule format.
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 20 guests