i have created zurb foundation html/css/js project flat files using sublime 2 text editor. have setup local git , github windows use deploy azure websites. html nav below in fiddle. want create friendly url routing remove .html page name. since site has 8 pages, manually create/update web.config file without having use visual studio.
http://jsfiddle.net/setbon/smvdv/
below web.config code in root directory , set-up redirect www. canonical domain without www, rule need add please .html becomes friendly url ?
once more..i not want use have use asp.net routing framework - it's 8 pages ... manually have rule coded seems more efficient.
<?xml version="1.0"?> <configuration> <system.webserver> <rewrite> <rules> <rule name="canonical hostname" stopprocessing="false"> <match url="(.*)" /> <conditions logicalgrouping="matchall" trackallcaptures="false"> <add input="{http_host}" pattern="^(www\.)(.*)$" /> </conditions> <action type="redirect" url="http://{c:2}{request_uri}" redirecttype="permanent" /> </rule> <rule name="convert lower case" stopprocessing="true"> <match url=".*[a-z].*" ignorecase="false" /> <action type="redirect" url="{tolower:{r:0}}" redirecttype="permanent" /> </rule> </rules> </rewrite> </system.webserver> </configuration>
try looking these answers url:
- https://stackoverflow.com/questions/15012893/iis-url-rewrite-how-to-remove-directory-and-extension
- https://stackoverflow.com/questions/10210936/url-rewrite-remove-html-extension
update:
its works fine static files:
<rules> <rule name="rewrite rule"> <match url=".*" /> <conditions> <add input="{staticrewrites:{request_uri}}" pattern="(.+)" /> </conditions> <action type="rewrite" url="{c:1}" /> </rule> <rule name="remove html extension" stopprocessing="true"> <match url="^(.+)\.html$" /> <action type="redirect" url="{r:1}" redirecttype="permanent" /> </rule> </rules> <rewritemaps> <rewritemap name="staticrewrites" defaultvalue=""> <add key="/file1" value="/file1.html" /> <add key="/file2" value="/file2.html" /> <add key="/folder/file3" value="/file3.html" /> </rewritemap> </rewritemaps>
more info:
Comments
Post a Comment