Hi all,
I've been working on a blogging engine for my site recently and have hit accross an issue with urls being different on my live site when compared to my development machine.
I'm using a custom url writer to remap SEO friendly urls to the required page.
For example: http//:empirical-design.com/posts/building+a+better+web.aspx
should remap to:
http://www.empirical-design.com/post.aspx?id=19fe4e9c-135d-4570-9cad-a8d5b8c683df
On my development machine this is working as planned. Any postbacks on the page are registered to
http://localhost:53022/post.aspx?id=19fe4e9c-135d-4570-9cad-a8d5b8c683df and the client callbacks are pointing correctly allowing me to preview or add a comment to the site using the ICallbackEventHandler.
On the live server any postbacks occurring are registering to
http://www.empirical-design.com/posts/post.aspx?id=19fe4e9c-135d-4570-9cad-a8d5b8c683df
As you can see it is inserting the extra path "/posts/" into the url.
I've checked the post results in firebug to confirm this.
Local:
POST http://localhost:53022/post.aspx?id=19fe4e9c-135d-4570-9cad-a8d5b8c683df
Live:
POST http://www.empirical-design.com/posts/post.aspx?id=19fe4e9c-135d-4570-9cad-a8d5b8c683df
In my httpModule im using
context.RewritePath((String.Format("{0}post.aspx?id=", VirtualPathUtility.ToAbsolute("~/")) + objPost.Id.ToString() + GetQueryString(context), False)
to rewite the url (VB). I can't for the life of me get this to factor correctly. Does anyone have any ideas?
Many thanks in advance.
Update**************
Thanks Abhishek Sur for your input. I'm using context.RewritePath though which requires a virtual path so I can't use the absolute Url (have I missed something?