Manual 301 redirect question

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
3/25/2011 2:06:29 PM
Gravatar
Total Posts 15

Re: Manual 301 redirect question

I did some more research and the issue is that a URL like mysite.com/ct/?page_id is passed to default.aspx and so there isn't a way to redirect that in the redirect manager (I tried /ct/?page_id=11 for example).  So the solution I ended up with was creating a Redirect.aspx file in the mojo root directory and am manually doing 301 redirect using the Response object based on the page_id parameter (if it's present).  If it's not present (i.e. it may be a normal mojo request to the root directory) then I do a Server.Transfer to default.aspx to let the normal mojo processing occur.  In IIS I had to set the default document of the Redirect.aspx to be higher priority than default.aspx.

Thanks, Mark

3/27/2011 8:24:58 AM
Gravatar
Total Posts 18439

Re: Manual 301 redirect question

I "think" you could solve this using the IIS UrlRe-writing module, it can do pattern based re-directing

Using IIS 7 Url Rewrite module

301 redirects and url rewrite rules

But be careful, it is possible to configure that module with rules that break mojoportal.

Hope it helps,

Joe

3/27/2011 12:07:32 PM
Gravatar
Total Posts 139
"All that is gold does not glitter, not all those who wander are lost;" --J.R.R. Tolkien

Re: Manual 301 redirect question

Which rules in particular could break Mojo Portal?  I ask since you know how curious I am, and you never know when I might just have to worry about it. 

3/27/2011 12:18:26 PM
Gravatar
Total Posts 18439

Re: Manual 301 redirect question

I helped someone the other day who was having strange behavior in the File Manager and it turned out to be caused by a rule in the IIS Url Rewrite module to force all lower case urls. He did not even intend that rule to be applied to the mojoportal site, it was for another site, but I guess the way he configured it, it was applying to all sites.

This is just one example I know of, but anything that changes the urls before it gets to application code is a place where problems can be introduced, not just in mojoPortal but in any app, but especially in apps like mojoPortal that do their own url rewriting internally. And it can be difficult to diagnose for someone like me trying to provide support for problems and not knowing about such configuration that may have been done on the server that changes the web request before it gets to mojoPortal.

Best,

Joe

 

3/27/2011 12:37:31 PM
Gravatar
Total Posts 139
"All that is gold does not glitter, not all those who wander are lost;" --J.R.R. Tolkien

Re: Manual 301 redirect question

Oh wow.  That sounds like it was kind of a pain, considering you were unaware of most of the other configurations. 

1/20/2012 12:33:28 AM
Gravatar
Total Posts 4

Re: Manual 301 redirect question

Hi...

I was racking my brain, trying to figure out why my 301 manual redirects weren't working and ended up stepping through code to see what I was missing.  It turns out that I hadn't set my config to allow for the rewriting of static files:

  <add key="UseUrlReWritingForStaticFiles" value="true"/>

I'm curious if I just missed this in the docs... or did I find an improper work-around.

Andrew

1/22/2012 7:51:34 AM
Gravatar
Total Posts 18439

Re: Manual 301 redirect question

Hi,

I've updated the 301 Redirect documentation to mention that setting.

Thanks,

Joe

You must sign in to post in the forums. This thread is closed to new posts.