Reputation: 280
I have a asp.net mvc website hosted on godaddy shared server. I want to write a url rewrite rule which would remove the virtual directory name.
Below are few my website URLs. All URLs works. but I want to redirect any url that has virtual directory name (breederyellowpages) in it to the root.
http://www.breederyellowpages.com
http://www.breederyellowpages.com/breederyellowpages
I tried to research & implement couple of ways of doing that. but its either not working or I am doing it wrong.
https://weblogs.asp.net/jhallal/remove-hosting-folder-name-from-mvc-url
Upvotes: 0
Views: 578
Reputation: 4246
Give this one a try:
<rule name="RemoveVirtualDirectory">
<match url="breederyellowpages/(.*)" />
<action type="Rewrite" url="/" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.breederyellowpages.com$" />
</conditions>
</rule>
Upvotes: 0