Friendly urls

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.
10/29/2006 1:11:30 AM
Gravatar
Total Posts 68

Friendly urls

Hi,

I have some pages in a sub folder (like "http://www.mydomain.com/Subfolder/ThePage.aspx"), and I want to use friendly urls to access them (http://www.mydomain.com/thepage.aspx"), but all i get when i use the friendly url is a blank page. It looks like everything is correct entered, in the db as well. The pages works correct but not the friendly url. The difference from the other friendly urls is that they use Default.aspx?pageid=123 and modules added to the pages.

Thanks!

Christian

10/29/2006 2:30:18 AM
Gravatar
Total Posts 18439

Re: Friendly urls

Hmm,

I'm not sure whats going on there, I think you will have to step through the code for url re-writing and see whats going on. It really was designed for mapping friendly urls to pages in the content system which are all Default.aspx?pageid=x but in theory it should be able to work with other pages, I've just never tested doing that. If you find something to fix it without breaking the other pages we can certainly tweak it.

Joe
10/29/2006 9:40:48 PM
Gravatar
Total Posts 68

Re: Friendly urls

Hi,

I changed a bit of code in the RewriteUrl method in SiteUtils to make it work. Previous only urls with '?' in it would be rewritten. Here is what I've done:

if (friendlyUrl.FoundFriendlyUrl)
{
if (friendlyUrl.RealUrl.IndexOf('?') > 0)
{
realPageName = friendlyUrl.RealUrl.Substring(0, friendlyUrl.RealUrl.IndexOf('?'));
queryString = friendlyUrl.RealUrl.Substring(friendlyUrl.RealUrl.IndexOf('?') + 1);
}
else // Added
{
realPageName = friendlyUrl.RealUrl;
}
if (log.IsDebugEnabled)
{
log.Debug("Rewriting URL to " + friendlyUrl.RealUrl);
}
app.Context.RewritePath(realPageName, string.Empty, queryString, true); // Removed if-statements
}

 

Christian

10/30/2006 1:48:24 AM
Gravatar
Total Posts 18439

Re: Friendly urls

Ok, I'll make the same change here.

Thanks,

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