Direct URL (how to?)

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/24/2010 8:02:09 PM
Gravatar
Total Posts 221

Direct URL (how to?)

I have the occasional need to create promotional direct URLs for clients that point to specific interior pages. For example, the url www.Domain.com/Promotion would take the visitor to www.domain.com/mypromotionpage.aspx

Typically advertising on billboards, TV, print include quick URLs without file extensions or long paths. Is there any way to allow URLs such as www.Domain.com/Promotion in Mojo? I tried the 301 admin page but it didn't work. Other ideas?

1/25/2010 7:25:35 AM
Gravatar
Total Posts 18439

Re: Direct URL (how to?)

Hi Eric,

I would expect that the 301 Redirect urls should work fine for that url if you have it configured for extensionless urls.

Best,

Joe

2/5/2010 9:25:23 PM
Gravatar
Total Posts 190

Re: Direct URL (how to?)

I was also spending some time trying to figure out how to get mojoPortal to do this for me. I think I devised a pretty good workaround as long as you have just a few URLs that you want to do this with. I needed a URL such as http://www.mysite.com/bike/. So I just added a folder 'bike' and put a Default.aspx page in it. In the page load event I have Server.Transfer("~/Default.aspx?pageid=n"). I just had to look up the un-friendly URL for the page I wanted to display. So when the page loads I still have my preferred URL in the address bar.

In keeping with good mojoPortal best practices, I have my own project for my custom stuff with the post build task to copy files to the mojoSolution. So I just added the folders and default pages to my project and added them to the post build script. Works like a charm.

John 

2/6/2010 10:14:59 AM
Gravatar
Total Posts 221

Re: Direct URL (how to?)

Interesting option. I found another way by using the 404 error page to look at the bad url and then redirect to my domain.com/bikes (mojo existing) page if there was a match. Sorry, I should have posted my solution.

The 301 wouldn't work in this case and either would the file extension removal. Clients often want direct urls long after pages are created, or direct urls that we wouldn't really want to name (or change) a page to.

I like your option as well, I'll have to look at both and see what is best for the longer term.

3/15/2010 10:22:38 AM
Gravatar
Total Posts 190

Re: Direct URL (how to?)

I found a really good solution for this. Check out:

http://weblogs.asp.net/fmarguerie/archive/2004/11/18/265719.aspx

This is a simple http module and was extremely easy to implement. 

3/30/2010 11:49:55 AM
Gravatar
Total Posts 190

Re: Direct URL (how to?)

Found some big problems with the redirect module. If you enter the url as '/foldername' it will work just fine, but when you enter it as '/foldername/' then things start to go wrong with the page and some graphics aren't showing up and it's really weird. It might be fixable but I didn't want to spend any more time on it. So much for doing things the hard way. When I stopped thinking about it for minute, I realized this is very easy to do in IIS. I just created a virtual folder and pointed it to a relative URL and it works great. That might not be the best way if you have many dozens of redirects that you want to do or if you really wanted the URL to remain 'http://website.com/foldername/', or if you don't have access to your web server settings. But for the handful that I need it's a very simple solution and lot less pain then all the code things I've been trying to do and breaking my mojoPortal installation in the process.

John

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