Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 330713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:42:25+00:00 2026-05-12T09:42:25+00:00

I am writing a simple HttpHandler for URL rewriting, but I’m hitting a brick

  • 0

I am writing a simple HttpHandler for URL rewriting, but I’m hitting a brick wall.

I have created a HttpHandler class that’s really simple just to test things:

public class HttpHandler : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        context.RewritePath("default.aspx", false);
        //Rewriter.Rewrite(context);
    }

    public bool IsReusable
    {
        get
        {
            return true;
        }
    }
}

I then have the following verb in the web.config:

<httpHandlers>
  <add verb="*" path="*" type="Tizma.CMS.Runtime.HttpHandler"/>
</httpHandlers>

I basically want all incoming URL’s to go through this rewritter. When I run this, ProcessRequest fires, but the RewritePath never gets to default.aspx.

Please bare in mind this is just a test and eventually default.aspx will be passed a query string along the lines of ?pageid=2 I just wanted to figure out how httphandlers worked first.

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:42:25+00:00Added an answer on May 12, 2026 at 9:42 am

    Andy – you can’t call RewritePath() in a handler – it’s way to late for that at that time. By the time you hit your handler the request has already routed to completion and RewritePath() doesn’t do anything.

    RewritePath must be called very early in the request cycle (like BeginRequest or anything before the CacheModule kicks in) to be effective so you most likely need an HttpModule and hook the appropriate early pipeline event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing a simple program that will find exact duplicate files on my computer, but
I'm writing simple tool to keep every image that I've copied (URL of image)
I'm writing a simple app that's going to have a tiny form sitting in
I am writing simple site that requires users and profiles to be handled. The
I'm writing a simple class in C++ for a class (school, not code). I
I have an HttpHandler class (implements IHttphandler) where the path defined for the handler
I writing simple application that need to make some record of the incoming sound.
I'm learning Rails by writing simple TODO tasks aplication. Two models are: class List
I am writing simple blog with CodeIgniter and DataMapper and I have problem with
This is a really basic ruby gems question. I'm familiar with writing simple ruby

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.