Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi guys
I'm currently making sure that if someone would hit a page with a .aspx suffix is 301 redirected to the page without the suffix. So if one would hit
mysite.com/page.aspx one would be redirected to mysite.com/page
This is also working fine. However when I hit a page that has a querystring it's not doing the redirect. Say I have this page
mysite.com/page.aspx?param=true then the redirect does not happen. What I want to see is that I end up here: mysite.com/page?param=true
I'm using the UrlRewriting.config and I'm using the below rule. I'm not that skilled doing this stuff so any hints are highly appreciated.
<add name="trim_aspx_from_directory_urls" redirect="Application" redirectMode="Permanent" virtualUrl="^/(?![0-9]+.aspx)(?!umbraco/)(.*).aspx$" rewriteUrlParameter="IncludeQueryStringForRewrite" destinationUrl="/$1" ignoreCase="true" />
Cheers, Jan
Hi Cheers,
I have this working for me just try changing
rewriteUrlParameter="IncludeQueryStringForRewrite"
rewriteUrlParameter="ExcludeFromClientQueryString"
and set <add key="umbracoUseDirectoryUrls" value="true" />
//fuji
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Trimming .aspx urls preserving querystrings
Hi guys
I'm currently making sure that if someone would hit a page with a .aspx suffix is 301 redirected to the page without the suffix. So if one would hit
mysite.com/page.aspx one would be redirected to mysite.com/page
This is also working fine. However when I hit a page that has a querystring it's not doing the redirect. Say I have this page
mysite.com/page.aspx?param=true then the redirect does not happen. What I want to see is that I end up here: mysite.com/page?param=true
I'm using the UrlRewriting.config and I'm using the below rule. I'm not that skilled doing this stuff so any hints are highly appreciated.
Cheers, Jan
Hi Cheers,
I have this working for me just try changing
and set <add key="umbracoUseDirectoryUrls" value="true" />
//fuji
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.