473,651 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with Theme and Context.Rewrite Path()

Hi,
I'm using Context.Rewrite Path() in a HttpModule to get url rewriting done.
http://localhost/Web1/articles ->
http://localhost/Web1/Default.aspx?m=articles

But I'm having problems with Themes when I'm using that.
The problem rises when my url ends with a '/'.

Example:
http://localhost/Web1/articles
works fine

but
http://localhost/Web1/articles/
doesn't.

My path's to my theme resources are messed up, being appended to the
url, like this:
http://localhost/Web1/articles/App_T...v/Articles.css

Has anyone else had this problem (and hopefully fixed it :)

Btw, I rewrite the path back to the original one in Page.OnPreInit( ) to
get my postbacks go to the rewritten url...

Best regards,
Mats Lycken
Aug 24 '06 #1
3 2427
I had this exact problem. I fixed it by detecting the trialing '/' and
redirecting to the same URL without the '/'. Not very elegant but it worked,

Kevin Jones

Ma***@newsgroup s.nospam wrote:
Hi,
I'm using Context.Rewrite Path() in a HttpModule to get url rewriting done.
http://localhost/Web1/articles ->
http://localhost/Web1/Default.aspx?m=articles

But I'm having problems with Themes when I'm using that.
The problem rises when my url ends with a '/'.

Example:
http://localhost/Web1/articles
works fine

but
http://localhost/Web1/articles/
doesn't.

My path's to my theme resources are messed up, being appended to the
url, like this:
http://localhost/Web1/articles/App_T...v/Articles.css

Has anyone else had this problem (and hopefully fixed it :)

Btw, I rewrite the path back to the original one in Page.OnPreInit( ) to
get my postbacks go to the rewritten url...

Best regards,
Mats Lycken
Aug 24 '06 #2
Thanks Kevin,
I feared that would have to be my solution :\

//Mats

Kevin Jones wrote:
I had this exact problem. I fixed it by detecting the trialing '/' and
redirecting to the same URL without the '/'. Not very elegant but it
worked,

Kevin Jones

Ma***@newsgroup s.nospam wrote:
>Hi,
I'm using Context.Rewrite Path() in a HttpModule to get url rewriting
done.
http://localhost/Web1/articles ->
http://localhost/Web1/Default.aspx?m=articles

But I'm having problems with Themes when I'm using that.
The problem rises when my url ends with a '/'.

Example:
http://localhost/Web1/articles
works fine

but
http://localhost/Web1/articles/
doesn't.

My path's to my theme resources are messed up, being appended to the
url, like this:
http://localhost/Web1/articles/App_T...v/Articles.css
Has anyone else had this problem (and hopefully fixed it :)

Btw, I rewrite the path back to the original one in Page.OnPreInit( )
to get my postbacks go to the rewritten url...

Best regards,
Mats Lycken
Aug 25 '06 #3
Hello Mats,

Does Kevin's sugegstion helpful for your case?

As for the Rewriting, are you only using a HttpModule to perform the
urlrewriting? Based on my understanding, ASP.NET runtime will only receive
request which is targeting the ASP.NET specific document extensions (like
.aspx, .ascx..... ). And for the below style request path, IIS won't
forward it to ASP.NET runtime, have you also used other rewrite components
or are you only testing in VS 2005 test webserver?

http://localhost/Web1/articles
http://localhost/Web1/articles/

In addition, here is a web article which has mentioned a theme's path
rebasing issue when using URL Rewriting, it indicate that we can use the
HttpContext.Rew ritePath's override version to choose not rebase the url:

http://davidhayden.com/blog/dave/arc...1/14/2693.aspx

Anyway, please feel free to let me know if there is anything I missed or if
you have any particular concerns in your scenario.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2258
by: Matt Howeson | last post by:
Some time ago I posted a request for help with a problem I was having sometime ago whereby a 404 error would result if any access to the Querystring had been made before the Context.Rewritepath is called. (http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=66a19 d98.0212240627.3f123293%40posting.google.com) I have recently received a number of emails from people asking if I ever found a solution, so I thought I'd post...
0
2649
by: Ayende Rahien | last post by:
I've a very annoying problem, I'm using Application_BeginRequest() and Context.RewritePath to hide query strings. The problem that I've is that a form that I submit to /Comments/17.aspx has form action of CommentView.aspx?story=17 (which is where the Context.RewritePath sent it). The problem that I'm having is that the end result is that the form end up being submitted to /Comments/CommentView.aspx?story=17, which doesn't even exist....
0
1508
by: Ayende Rahien | last post by:
I've a very annoying problem, I'm using Application_BeginRequest() and Context.RewritePath to hide query strings. The problem that I've is that a form that I submit to /Comments/17.aspx has form action of CommentView.aspx?story=17 (which is where the Context.RewritePath sent it). The problem that I'm having is that the end result is that the form end up being submitted to /Comments/CommentView.aspx?story=17, which doesn't even exist. How...
1
3113
by: Oytun YILMAZ | last post by:
Hi I thing I have found a critical bug about ASP.NET ReWritePath Function Here are the steps to reproduce: I have a solution with this items: "MasterPageWithoutUserControl.aspx" "MasterPageWithUserControl.aspx" "OrdinaryPage.aspx"
15
6720
by: James Higgs | last post by:
For a long time, our product has had a "vanity URLs" feature where nice URLs are mapped to ASPX files in an IHttpModule implementation, using HttpContext.RewritePath(). This has worked beautifully for the past couple of years under .NET 1.1, but when it runs under ASP.NET 2.0 it has problems. Note that this is the case regardless of whether the assmbly is built against 1.1 or 2.0 We're getting the following exception stack trace: ...
0
1433
by: cpnet | last post by:
I was playing around with Beta 2 of VS2005, .NET 2.0, and built an IHttpModule do allow me to have nice URL's in my web app. It was working great. I had a URL like: http://mydomain.com/Users/BobSmith/ or http://mydomain.com/Users/BobSmith The "BobSmith" didn't actually exist. My HttpModule would use RewritePath method to return a page from:
1
2446
by: Alan Silver | last post by:
Hello, I have a page where site owners can see orders placed on their site. The path to this page is /dap/order.aspx, but for security reasons (as they will end up printing these pages and sending them to customers) I am trying to rewrite the path so the URL shown in the page footer is not a real one. I want to use an URL like http://www.domain.com/order123.aspx and have it rewritten to http://www.domain.com/dap/order.aspx?orderid=123
0
1405
by: Andrew2 | last post by:
Sorry guy for the (probably) stupid question, but reading and testing the second overload of the Context.RewritePath, that one with the rebaseClientPath param. Msdn says: true to reset the virtual path; false to keep the virtual path unchanged. I'd tried to use both combination and I'm not able to see any changes in the address bar, in Context.Request.RawUrl nor Context.Request.Path.
1
3469
by: Keef | last post by:
Hiya... just wondering if anyone else has come across this problem, and if there is a solution... i'm writing a reasonably simple IHttpModule to rewrite URLs ... in the BeginRequest event i do a app.Context.RewritePath("~/"+theFile,false) to the aspx file to display the content, then in the PreRequestHandlerExecute i do another RewritePath so that all the relative
0
8792
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8694
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7294
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.