The problem: Now if I try to open maindomain.com/umbraco/ , it is also redirecting to the maindomain.com rather than login page. I am not able to login.
Is there any way I can solve this and get my login.aspx page to enter into??
Well its redirecting because you are hitting a .aspx page when you go to Umbraco/ are you not? Well the easy way would just be to add another rule to say if anyone hits /umbraco page then do not redirect. Not sure if this actually helps :/. Charlie
/umbraco/login.aspx redirects to main domain
Hi,
I am trying to redirect the .aspx url's to without .aspx like /maindomain/product.aspx to /maindomain/product as client requested.
I did the following:
<add key="umbracoUseDirectoryUrls" value="true" />
<addTrailingSlash>false</addTrailingSlash>
and then I added the rule if someone try to add .aspx manually after the url then it will also redirect.
<add name="rule1"
redirect="Domain"
ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
virtualUrl="http://maindomain.com/(.*).aspx"
redirectMode="Permanent"
destinationUrl="http://maindomain/$1" />
It works the way I want.
The problem: Now if I try to open maindomain.com/umbraco/ , it is also redirecting to the maindomain.com rather than login page. I am not able to login.
Is there any way I can solve this and get my login.aspx page to enter into??
Please, reply any solution to this.
Thank you,
Sundip
Any help!!
Well its redirecting because you are hitting a .aspx page when you go to Umbraco/ are you not? Well the easy way would just be to add another rule to say if anyone hits /umbraco page then do not redirect. Not sure if this actually helps :/. Charlie
So a a simple way would just be to catch /umbraco/ and then redirect it to /umbraco/ thus you are bypassing the first rule you have set up :)
Hey Charles,
Thanks for the suggestion.
I tried that and still it takes the first rule and redirect "www.maindomain.com/umbraco/login.aspx?redir=%2fumbraco%2f" to "www.maindomain.com".
Means it removes the .aspx after login with the previous rule.
If you have a sample of ignoring the previous rule than please share.
Thank you,
Sundip
Hey, i can have a look for you, i was hoping that because the second was more specfic that it would take that rule over the more general one.
Could you post the rule you wrote for it? Thanks. Charlie :).
I have the general rule as following and then I added for Umbraco login as you suggested, there might be the problem.
Would you please correct if you have any idea.
General rule:
<add name=".aspx removal"
redirect="Domain"
ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
virtualUrl="http://www.maindomain.com/(.*).aspx"
redirectMode="Permanent"
destinationUrl="http://www.maindomain.com/$1" />
For Umbraco login:
<add name=".aspx removal"
redirect="Domain"
ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
virtualUrl="http://www.maindomain.com/umbraco/"
redirectMode="Permanent"
destinationUrl="http://www.maindomain.com/umbraco/login.aspx/redir=%2fumbraco%2f" />
Thank you,
Sundip
We use the IIS redirect module so we can make rules in the web.config.
This is what I have for stripping .aspx:
This way you can easily setup conditions for your rules. You can do a lot of magic with it.
Here you redirect to the url without .aspx, except if the request uri contains umbraco, then it doesn't do anything. Sounds like what you needed.
Hey Niels,
Thank you very much. Your solution is perfect.
In web.config it is showing me that 'system.webserver has invalid child element rewrite.....'. Why is that message?
It works fine though, I am able to login in Umbraco..
edit:
Sorry, I was trying to click your answer as solution. Is there any way to undo this??
Thanks again,
Sundip
Hmm maybe your missing some elements in the XML.
It is purely speculation though. A quick search on google turned up with some XML schema that might be a bit wonky. So can't really say for sure.
http://stackoverflow.com/questions/9280803/element-system-webserver-has-invalid-child-element-rewrite-should-i-fix-thi ;
That seems like a better implimentation :). Thats the same sort of thing you would do in sitecore. Thanks Niels
Hey Niels,
I wrote the same thing. It's working fine.
I will try to resolve that error message in web.config.
Thank you so much for help Niels and Charles.
is working on a reply...