Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

url rewrite in Delphi

20 views
Skip to first unread message

VT Venkatesh

unread,
Jul 14, 2008, 1:25:42 PM7/14/08
to
I am trying to do a url rewrite in a delphi eco asp.net application with
urlRewriter.How ever it is not working & no rewrite is taking place
I have used in my web.confg
**************************
<configSections>
<section
name="rewriter"
requirePermission="false"
type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler,
Intelligencia.UrlRewriter" />
</configSections>
<rewriter>

<httpModules>

<add type="Intelligencia.UrlRewriter.RewriterHttpModule,
Intelligencia.UrlRewriter" name="UrlRewriter" />

</httpModules>


<rewrite url="~/mytest.aspx" to="~/productdetails.aspx?product=1" />

</rewriter>
**********************************************************

Has any one else tried 'Rewrite' successfully ?
Venkatesh

John Moshakis

unread,
Jul 14, 2008, 9:32:37 PM7/14/08
to
VT Venkatesh wrote:

> I am trying to do a url rewrite in a delphi eco asp.net application
> with urlRewriter.How ever it is not working & no rewrite is taking
> place

Hi Venkatesh,

Is there documentation for this other than in the readme ?

urlrewriter.net doesn't seem to work and I can't find anything at
sourceforge.

Cheers,
John

--
Blog: http://blog.moshine.com/

VT Venkatesh

unread,
Jul 14, 2008, 11:35:17 PM7/14/08
to
Hi John
I find lot of people using it effectively in C#.Does it mean that it
does not work in Delphi asp.net.
How does one do rewrite in delphi asp.net ?
venkatesh

John Moshakis

unread,
Jul 15, 2008, 12:27:06 AM7/15/08
to
VT Venkatesh wrote:

> I find lot of people using it effectively in C#.Does it mean that it
> does not work in Delphi asp.net. How does one do rewrite in delphi
> asp.net ?

It should work its just that the url in the readme
http://www.urlrewriter.net/ doesn't seem to.

Have you got a link to a csharp example ?

VT Venkatesh

unread,
Jul 15, 2008, 1:23:14 AM7/15/08
to

VT Venkatesh

unread,
Jul 15, 2008, 10:28:44 AM7/15/08
to
John Moshakis wrote:

> It should work its just that the url in the readme
> http://www.urlrewriter.net/ doesn't seem to.
>
> Have you got a link to a csharp example ?
>
>
>
> Cheers,
> John
>
>
>

Hi John
Now it works in delphi too
Venkatesh

Mark Tiede

unread,
Jul 15, 2008, 12:57:30 PM7/15/08
to
Care to share?


"VT Venkatesh" <ve...@vsnl.com> wrote in message
news:487c...@newsgroups.borland.com...

VT Venkatesh

unread,
Jul 15, 2008, 10:42:14 PM7/15/08
to
Hi Mark
Certainly
Download url rewriter assembly from
http://urlrewriter.net/index.php/download.
Add the reference to the assembly to the delphi asp.net application
Decide on the friendly URLs
In the web.config file add under Configuration .Should be the first
element under confighuration node)
**********************************************
<configuration>

<configSections>
<section name="rewriter"
requirePermission="false"

type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler,
Intelligencia.UrlRewriter" />
</configSections>
***************************************************


Now write the friendly url & the real url as under(as many as required)
*******************************************************
<rewriter>
<rewrite url="/Path/Friendly.aspx"
to="/Path/ProductDetails.aspx?product=1" />
********************************************************

(Friendly.aspx is the link in your web page &
ProductDetails.aspx?product=1 is the actual link.In the web page the
user will see Friendly.aspx & not ProductDetails.aspx?product=1 since
friendly.aspx is more search engine friendly)

Now add (under httpModules )
*********************************
<httpModules>

<add name="UrlRewriter"
type="Intelligencia.UrlRewriter.RewriterHttpModule,
Intelligencia.UrlRewriter"/>

</httpModules>

**********************************

Now when you run the application & click the link you will see
friendly.aspx as the url
See the nice article
http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
The only change i have to make was to remove ~ in
<rewrite url="~/products/books.aspx"
to="~/products.aspx?category=books" />
For me it was
<rewrite url="/products/books.aspx" to="/products.aspx?category=books"

I am yet to test in my shared host .I am running it my local machine
where there is path.In the server i will be running it directly under
root(/)


Venkatesh


> Care to share?
>
>
>

Mark Tiede

unread,
Jul 16, 2008, 10:16:07 AM7/16/08
to
VT,

Thanks. I wanted to do something like this a long time ago when I
started doing my ISAPI dll. Maybe I will eventually look and see if that
will work for ISAPI too somehow.

So far, I have stayed away from ASP.NET. It seemed to complicated to me.
The ISAPI model is pretty darn simple, but covers the bases. After all,
ASP.NET is just ISAPI under the covers so I figure if it is good enough for
it, then it is good enough for me. And I don't have to have any extra
layer. And not much of what ASP.NET has would apply to me anyway. My main
app just generates SVG into a few frames. No data entry, grids of data
etc... Just visual stuff.

Thanks again. I wasn't sure when you said it was solved if you had used
the link or found something else...


"VT Venkatesh" <ve...@vsnl.com> wrote in message

news:487d5ed7$1...@newsgroups.borland.com...

John Moshakis

unread,
Jul 17, 2008, 10:45:01 AM7/17/08
to
Mark Tiede wrote:

>
> Thanks. I wanted to do something like this a long time ago when I
> started doing my ISAPI dll. Maybe I will eventually look and see if
> that will work for ISAPI too somehow.
>
> So far, I have stayed away from ASP.NET. It seemed to complicated to
> me. The ISAPI model is pretty darn simple, but covers the bases.
> After all, ASP.NET is just ISAPI under the covers so I figure if it
> is good enough for it, then it is good enough for me. And I don't
> have to have any extra layer. And not much of what ASP.NET has would
> apply to me anyway. My main app just generates SVG into a few
> frames. No data entry, grids of data etc... Just visual stuff.
>

Hi Mark,

I'm guessing svg is xml ? You don't need to use webpages with asp.net
controls. You can create "generic handlers". They are just classes with
a single method in which you compose your markup and write it out to
the response.

For example

procedure THandler1.ProcessRequest(Context: HttpContext);
begin
Context.Response.ContentType := 'text/html';
Context.Response.Write('<head>');
Context.Response.Write('<title>Handler1</title>');
Context.Response.Write('</head>');
Context.Response.Write('<body>');
Context.Response.Write('Hello World!');
Context.Response.Write('</body>');
Context.Response.Write('</html>');
end;

If you just use those you can still leverage the dotnet framework
serverside. I've done projects where the client side is all html and
I'm generated json in handlers for the UI.

Mark Tiede

unread,
Jul 18, 2008, 11:27:24 AM7/18/08
to
John,

What benefits does the ASP.NET offer versus my ISAPI app? ISAPI seems to
give me everything I want. I have very little html and a lot of generated
xml (svg). It seemed to me that the main thing ISAPI missed was "session"
which I have an object for since I don't want to rely on cookies.

Sorry if this seems like a dumb question.


VT Venkatesh

unread,
Jul 18, 2008, 12:26:27 PM7/18/08
to
Hi Mark
asp.net contains good set of controls & the provider model for role
based applications(also supported by eco).There are lot of third part
controls (including free controls) which make the UI very easy to develop.
Venkatesh

John Moshakis

unread,
Jul 18, 2008, 2:15:31 PM7/18/08
to
Mark Tiede wrote:

>
> What benefits does the ASP.NET offer versus my ISAPI app? ISAPI
> seems to give me everything I want. I have very little html and a
> lot of generated xml (svg). It seemed to me that the main thing
> ISAPI missed was "session" which I have an object for since I don't
> want to rely on cookies.
>

In addition to what Venkatesh said, I find the depth of the framework
very beneficial. Not only can you do alot with it but there are usually
plenty of 3rd party libraries or snippets of code that you can make use
of.

Also if you start using something like Eco for data access then that
gives you another advantage.

I assume your using webbroker, at its core asp.net is very similar.

Mark Tiede

unread,
Jul 21, 2008, 3:58:05 PM7/21/08
to
John,


"John Moshakis" <jo...@moshakis.com> wrote in message
news:4880ddac$1...@newsgroups.borland.com...


> Mark Tiede wrote:
>
> In addition to what Venkatesh said, I find the depth of the framework
> very beneficial. Not only can you do alot with it but there are usually
> plenty of 3rd party libraries or snippets of code that you can make use
> of.
>
> Also if you start using something like Eco for data access then that
> gives you another advantage.
>
> I assume your using webbroker, at its core asp.net is very similar.

Yep. Using webbroker, which really, I like a lot. It is a VERY simple
framework that allows great flexibility. Currently, my web user interface
is SVG with a thin veneer of Javascript, html and frames. I am about to
embark on completely redoing my suite of applications. I intend to switch
to Eco which reduce some of my code by 70% or more and do more and do it
better. For the user interfacing on the web, I am considering replacing the
SVG pieces/parts with XAML and Silverlight. My user interface is primarily
pictures with navigation controls. So all those third party controls which
I assume would be perhaps some sort of data aware controls don't apply. But
there is lots of cool stuff I could do with XAML. Not quite sure at the
moment how that XAML stuff will fit in with Webbroker and I'm a little
concerned about the move away from webbroker (or at least an emphasis on
newer technology).

Still in the evaluation process. Hence the questions.

0 new messages