Developer forum

Forum » Development » RewritePath in recent version of Dynamicweb

RewritePath in recent version of Dynamicweb

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,


I am in the process of upgrading a site running on a 19.1.x version of DW to the latest version, but I am running into some issues. We have some old and custom rewrite code to handle SEO URLs before they were introduced in DW. Here's the gist of my code from Global.asax (in the Application_AuthenticateRequest handler):

app = CType(sender, HttpApplication)
app.Context.RewritePath("/hbo/volledige-hbo-opleidingen.aspx", "", "CursusGroepId=9412")

Based on some custom logic, I redirect using RewritePath to hbo/volledige-hbo-opleidingen.aspx which is a physical page in Dynamicweb (volledige-hbo-opleidingen is located under hbo which is located in the root). The page volledige-hbo-opleidingen has a custom module that should react to the query string CursusGroepId. The CursusGroepId=9412 part is dynamic and changes to different IDs based on the client URL being requested.

This all used to work fine in the current version of DW (19.1.*), but seems to break when I run this on the latest version. The Rewrite path seems to trigger just fine, but after that, the page with the custom module isn't executed. Instead, I am seeing content as if I had requested "/Hbo.aspx" (the parent page) directly.

Any idea what's going on and how to work around this?

Thanks,

Imar


Replies

 
Yury Zhukovskiy
Reply

Hi Imar,

Did you tried to turn off Customized URL in DW and continue using the old solution:

 

app = CType(sender, HttpApplication)
app.Context.RewritePath("/hbo/volledige-hbo-opleidingen.aspx", "", "CursusGroepId=9412")

 

It should work properly theoretically.

 

 

Kind Regards

Zhukovskiy Yury

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

In theory: maybe. In reality: it doesn't ;-(

Even with the customized URLs turned off, it's still not working, and still displaying the parent page of HBO. Also, I can't turn of the existing customized URLs as I'll break a million links in the current website.

Something else is going on, but I can't figure out what it is. Any other ideas I could look into?

Imar

 

You must be logged in to post in the forum