asp.net - IIS URL Rewrite rule - Default document for subdirectories -


I would like to create a URL rewrite rule that will set the default document for my virtual folders. like. This way some time ago

  www.domain.com/en/ - & gt; Www.domain.com/en/index.aspx www.domain.com/hr/ - & gt; Www.domain.com/hr/index.aspx www.domain.com/de/ - & gt; Www.domain.com/de/index.aspx  

Directories, HR, D is not actually present on the web server, they are used only in the site used for home languange The module for which the module rewrites the path with the query parameter.

The quick solution defines the rule of every one, something like this:

   & Lt; Add key = "/ hr" value = "/ hour / index.aspx" /> & Lt; Add key = "/ de" value = "/ de / index.aspx" /> & Lt; / RewriteMap & gt; & Lt; / RewriteMaps & gt; & Lt; Rules & gt;  

But I would really like the solution that will not require changes in web.config and will add the rewrite rule for every grief used on the particular site.

Thank you!

  & lt; Rule name = "Lang-Redirect" & gt; & Lt; Mail url = "^ (\ w {2}) \ /? $" / & Gt; & Lt; Action type = "rewrite" url = "{R: 1} /index.aspx" /> & Lt; / Rules & gt;  

This should allow you to capture the language tag from the request and re-write it on your custom http handler.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -