I know I can use http module in my asp.net project to rewrite url. However
that is only true for .aspx page, there are many other static page in my
application such as .htm. .asp, etc.
My question is:
1. Is it possible to map all those request (.gif, .jpg, .swf, .asp, .htm,
whatever) to my http module first?
2. Or in this situation, I have to use a ISAPI filter? 10 4252
Hi,
You could use a HTTPHandler in .net to handle specified requests.
You write your handler (to do whatever you want) then you have to
"register" it in your web.config. In there you specify which requests
to handle. These can be from anything ("*") to just one specific file
("mypage.aspx") . And yes you can handle .gif, .jpg, .swf etc. using
this method.
If you do a search on MSDN you should be able to find a couple of
articles on writing HTTPHandlers.
Regards,
Peter Chadwick (MCP) pe**@code-explorers.com
Thanks for your quick reply. I will try that.
"Peter Chadwick (MCP)" <pe**@code-explorers.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. . Hi,
You could use a HTTPHandler in .net to handle specified requests.
You write your handler (to do whatever you want) then you have to "register" it in your web.config. In there you specify which requests to handle. These can be from anything ("*") to just one specific file ("mypage.aspx") . And yes you can handle .gif, .jpg, .swf etc. using this method.
If you do a search on MSDN you should be able to find a couple of articles on writing HTTPHandlers. Regards,
Peter Chadwick (MCP) pe**@code-explorers.com
You can use an http module if you configure IIS to handle those file-type
requests using ASP.NET.
+ Open IIS Manager
+ Select your website
+ Right-click, Properties
+ Select Home Directory tab
+ Click Configuration.. . button
You can see the application extension mappings here. Double click on, e.g.
the ".aspx" extension to see how the mapping to ASP.NET is setup.
You can duplicate this for all file types you want to pass through ASP.NET
(and your http module) by Adding / Editing as desired. Add one for .gif,
..jpg, .jpeg, and so on.
Note that on Server 2003 you can also do a wildcard mapping in the lower
listbox, however there are some disadvantages to this. Certain features
"break" such as default webpages. However if you have a very large number
of file types to map, you may want to explore this approach.
/// M
"Guoqi Zheng" <no@sorry.com > wrote in message
news:ef******** ******@TK2MSFTN GP11.phx.gbl... I know I can use http module in my asp.net project to rewrite url. However that is only true for .aspx page, there are many other static page in my application such as .htm. .asp, etc.
My question is: 1. Is it possible to map all those request (.gif, .jpg, .swf, .asp, .htm, whatever) to my http module first? 2. Or in this situation, I have to use a ISAPI filter?
Thanks for the replying, I got another problem, however if a direcory
without an file name in it.
such as http://www.mysite.com/aaaa/fakedirectory/
How can I catch this kind of URL?
"Guoqi Zheng" <no@sorry.com > wrote in message
news:ef******** ******@TK2MSFTN GP11.phx.gbl... I know I can use http module in my asp.net project to rewrite url. However that is only true for .aspx page, there are many other static page in my application such as .htm. .asp, etc.
My question is: 1. Is it possible to map all those request (.gif, .jpg, .swf, .asp, .htm, whatever) to my http module first? 2. Or in this situation, I have to use a ISAPI filter?
Hi,
This can be handled by specifying the default document in IIS. In the
properties of the website you can supply a list of default documents
(i.e. to try if no file is specified). It starts with files such as
default.htm, default.asp, default.aspx etc. but you can add your own.
Regards,
Peter Chadwick (MCP) pe**@code-explorers.com
That is what I think, but that does not work like it should be.
I think If I have a directory like http://www.mysite.com/aaaa/bbb/
IIS will check first to make sure whether that directory exists or not
before it load the default.aspx page. That direcotry is fake, so it is not
exists, so IIS return an page not found error.
Any idea?
"Peter Chadwick (MCP)" <pe**@code-explorers.com> wrote in message
news:11******** ************@z1 4g2000cwz.googl egroups.com... Hi,
This can be handled by specifying the default document in IIS. In the properties of the website you can supply a list of default documents (i.e. to try if no file is specified). It starts with files such as default.htm, default.asp, default.aspx etc. but you can add your own. Regards,
Peter Chadwick (MCP) pe**@code-explorers.com
Hi,
If IIS cannot find one of the default files it will return a page not
found error (because it isn't found).
I'm not really sure why you would want to try and load a page in a
directory that doesn't exist. Are you saying you want to know when a
url specifying a directory that doesn't exist is posted and handle that
in some special way, other than the not found special error?
Regards,
Peter Chadwick (MCP) pe**@code-explorers.com
I'm not sure that it would work....but I think it will.....
you're having to get around teh fact that IIS intercepts the request and
throws the 404 error PRIOR to the aspnet_pw getting a hold of it.
So, how about creating an ASPX doc and setting that to your custon page for
404 errors in IIS?
I know that this is a little clunky, but the issue here is that you need to
get IIS to get the request to .NET somehow...that' s the only way I can think
about it.
I could be wrong, though
"Guoqi Zheng" <no@sorry.com > wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. .. Thanks for the replying, I got another problem, however if a direcory without an file name in it. such as http://www.mysite.com/aaaa/fakedirectory/
How can I catch this kind of URL? "Guoqi Zheng" <no@sorry.com > wrote in message news:ef******** ******@TK2MSFTN GP11.phx.gbl... I know I can use http module in my asp.net project to rewrite url.
However that is only true for .aspx page, there are many other static page in my application such as .htm. .asp, etc.
My question is: 1. Is it possible to map all those request (.gif, .jpg, .swf, .asp,
..htm, whatever) to my http module first? 2. Or in this situation, I have to use a ISAPI filter?
Those direcotry are created by URL rewrite. Those directories are not really
there. That is why I need the URL rewrite http module.
To make the site easily understood by people and search, we change url like
cateogry.aspx?i d=2 to xxx/category/1.aspx
Any idea how can do this? Do I really have to use ISAPI filter?
"Peter Chadwick (MCP)" <pe**@code-explorers.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. . Hi,
If IIS cannot find one of the default files it will return a page not found error (because it isn't found).
I'm not really sure why you would want to try and load a page in a directory that doesn't exist. Are you saying you want to know when a url specifying a directory that doesn't exist is posted and handle that in some special way, other than the not found special error? Regards,
Peter Chadwick (MCP) pe**@code-explorers.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Aintzane |
last post by:
Hi!
Sorry if I'm asking silly things, but I'm new with ISAPI Filters.
That's what my filter does. When a user makes a request
the filter verifies if the user has already entered his password. If
it hasn't been entered, the user is redirected to the
login page, and after that it's returned to the previously requested
page. But to do all this I need to keep some
information about the session, and in ISAPI filter each HTTP request
is "a...
|
by: balaji |
last post by:
How can i design an ISAPI Filter that works with IIS-6.0 on win 2003 platform.
I already have an ISAPI Filter that i designed for working with IIS 5.x and
that works fine .
I am finding a problem with the ISAPI Filter designed for IIS 6 since the
SF_NOTIFY_READ_RAW_DATA is not supported.
Can anyone suggest an alternative for the above notification?
thks for any help.
|
by: Cybermedia Marketing |
last post by:
I'm trying to convert an ISAPI filter to an httpmodule. The ISAPI filter
added custom headers to the response which could later be accessed by the
asp page.
ISAPI Filter:
pvPrep->SetHeader(pfc, "Instance-Id:", info->instance_id);
pvPrep->SetHeader(pfc, "Company-Id:", info->company_id);
pvPrep->SetHeader(pfc, "Primary:", info->hostname);
pvPrep->SetHeader(pfc, "Profile:", buffer);
|
by: Jon Maz |
last post by:
Hi All,
I've been looking into options for URL Rewriting in .net, and to be honest,
I haven't seen anything that's easier than the old Classic Asp solution with
an ISAPI filter redirecting to an .asp page with responsibility for handling
the redirect.
I'm now planning to use this solution with my next .net project, and was
wondering if anyone else out there has done this already, and what problems
(if any) arise. Hopefully the news...
|
by: Dmitry Duginov |
last post by:
I have a virtual directory where I allow browsing. When I implemented ISAPI
filter for this directory (I deny access in some cases based on request
headers), the contents of the directory are not being generated anymore. How
do I (from my Http module code) explicitly call IIS script that generates
directory contents? Or suggest, please other options to achieve the same
result.
Thanks in advance,
Dmitry.
| |
by: Serg |
last post by:
How do I install ISAPI filter in IIS? I need ISAPI filter to process folder
paths such as http://MyUrl/folder1/folder2/folder3
There is no "ISAPI filters" tab in my IIS.
Thanks!
|
by: Yet another C# coder |
last post by:
Hi,
Does anyone know if in the next version of asp.net / C# (2.0)
Would be possible to write an ISAPI Filter in C#?
Thanx.
|
by: Jeeran |
last post by:
We use an ISAPI filter to convert long urls into short clean ones.
For example:
"Site.com/user/john/"
Is re-written as:
"Site.com/user/userinfo.aspx?uid=john"
Now, "userinfo.aspx" contains a web user control which uses some Atlas functionality;
The web user control contains a "DataList" which gets updated asynchronously
through Atlas when the user clicks a button –the button is the Atlas trigger.
|
by: Chris Curvey |
last post by:
Hi all,
I'm trying to write an ISAPI filter in Python, using the examples that
come in the "isapi" directory of the win32com package. The
installation program itself runs fine, but when I examine the
properties of my web server, my filter has a big red down arrow next to
it. But I can't seem to figure out where I should be looking to find
the trouble. If anyone can point me to the right place (or see an
obvious error in the code...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |