IIS7 and ASP.NET MVC4.5 have problem with .htaccess

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 27 Jan 2014, 12:14

IIS7 and ASP.NET MVC4.5 have problem with .htaccess

27 Jan 2014, 12:19

Hello,

We are using ISAPI_Rewrite3 since few years. I was working great with our ASP.NET WebForms site. We are creating new version of out website right now and we are using MVC4.5 Framework.

There is a problem with ISAPI_Rewrite3. Our new application works with rewrite rules only when they are entered in httpd.ini file. But when we use separate .htaccess for new website rules don't work. In the old project in WebForms rules works great even in separate .htaccess file.

Could you help us solve this issue?

Best Regards

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: IIS7 and ASP.NET MVC4.5 have problem with .htaccess

28 Jan 2014, 05:15

Hello,

Sound like you have installed ISAPI_Rewrire2, not 3. ISAPI_Rewrite2 supports httpd.ini, while ISAPI_Rewrite3 supports httpd.conf. Also ISAPI_Rewrite2 does not support per-site configuration.

Also, make sure you do not download LITE version, that has limitations (http://www.helicontech.com/isapi_rewrit ... itever.htm)

Regards

User avatar
Posts: 5
Joined: 27 Jan 2014, 12:14

Re: IIS7 and ASP.NET MVC4.5 have problem with .htaccess

28 Jan 2014, 05:57

It was httpd.conf. Sorry for a mistake. I have full version of ISAPI_Rewrite3 installed for sure.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: IIS7 and ASP.NET MVC4.5 have problem with .htaccess

28 Jan 2014, 06:24

In this case the issue might be in permissions. ISAPI_Rewrite simply can't access .htaccess files. Try to resolve by following http://www.helicontech.com/isapi_rewrit ... curity.htm

User avatar
Posts: 5
Joined: 27 Jan 2014, 12:14

Re: IIS7 and ASP.NET MVC4.5 have problem with .htaccess

28 Jan 2014, 07:41

I have added IIS_WPG and required permissions to sources directory. It still doesn't work.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: IIS7 and ASP.NET MVC4.5 have problem with .htaccess

28 Jan 2014, 09:37

ok. Now lets see what you use in your conf file. Please provide the rules you;re using

User avatar
Posts: 5
Joined: 27 Jan 2014, 12:14

Re: IIS7 and ASP.NET MVC4.5 have problem with .htaccess

28 Jan 2014, 09:57

I have tried to put rule from your FAQ:

Code: Select all
RewriteRule .? - [F]


and it does not work.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: IIS7 and ASP.NET MVC4.5 have problem with .htaccess

28 Jan 2014, 10:02

Did you put "RewriteEngine on" on top?

User avatar
Posts: 5
Joined: 27 Jan 2014, 12:14

Re: IIS7 and ASP.NET MVC4.5 have problem with .htaccess

28 Jan 2014, 12:39

Thank for this question, Andrew! Yes, I didn't have a RewriteEngine on on top. And I didn't had RewriteBase in my local .htaccess file. After writing those lines my .htaccess woks great. Many thanks!

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests