Virtual Directory asp.net mvc

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 19 Apr 2012, 11:04

Virtual Directory asp.net mvc

19 Apr 2012, 11:12

Hello everyone,

I have been trying to solve this problem for a few days but not succeed at at all.

I have a application deployed in a shared hosting . This app is in a subdirectory in the room www\root\myapp.

when I access the app the name of the virtual directory is add to my URL . myapp.rodominas.com/myapp/home/index

any actionlink or even ajax calls are broken since I should have a url like this myapp.rodominas.com/home/index.

is there any way to remove the virtual directory name from the url in any requisition in the website?

I appreciate the help. best regards.

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

Re: Virtual Directory asp.net mvc

20 Apr 2012, 06:51

Hello,

Please try using the following:

Code: Select all
RewriteEngine on
RewriteBase /

# 301 redirect myapp/home/index --> /home/index.
RewriteRule ^myapp/home/index$ /home/index [NC,R=301,L]
/home/index -->myapp/home/index
RewriteRule ^home/index$ /myapp/home/index [NC,L]


Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 8 guests