[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

How to Change URL Exrension from .aspx to .html

Asked by psaini172000 in Microsoft IIS Web Server

Tags: asp.net programming, IIS server

hi
i m developing a CMS. all pages are driven from database.
I want to change pages extension from .aspx to .html.
For this purpose i m using Global.asax file.(SEE BELOW CODE).

Its working well on localstation

.But when i host my application on web server it give error page not found.

First of all i want that u pls go to following link for better understanding.
http://www.legal-consumer-forum.com/home.aspx

I also want to describe that how it work on local station so that u can better understand of my problem.

when i click on any link on the page suppose (service or about us ) it forward the request to the global.asax.cs and in global.asax.cs file  when i check the first line of code . i found

strCurrenturl=http://localhost:2234/service.html

after that  it rewrite the url  here and  redirect the page to "~/LINKS.aspx
Now i m seeing  output in which the url   is  http://localhost:2234/service.html    and page contents are  of link.aspx.
The Same thing i want.

MY problem is that after host this web application on server if i m requesting  http://www.legal-consumer-forum.com/service.aspx then IIS compiling the global.asax.cs n its work fine.
BUT  IIS not compiling  the Global.asax.cs when i request for  http://www.legal-consumer-forum.com/service.html.
it search http://www.legal-consumer-forum.com/service.html directly in the root directory and it not found service.html and it is showing PAGE NOT FOUND.

If it will complile the Global.asax.cs then my code will work.
I have also mapped .html extension to aspnet_isapi.dll in IIS Manager
I want that when i request service.html it will compile the global.asax.cs


Any Help,suggestion for solving this problem will be Highly Appriciated.

THanks
sidharth






1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
protected void Application_BeginRequest(object sender, EventArgs e)
        {
            string strCurrenturl = Request.Url.ToString();
            strCurrentPath = Request.Path.ToLower();
 
 
            if (strCurrentPath.EndsWith(".aspx") || strCurrentPath.EndsWith(".html") || strCurrentPath.EndsWith(".htm"))
            {
                strCustomPath = "";
                strCustomPath = "~/LINKS.aspx?transfer=" + strCurrenturl;
                Context.RewritePath(strCustomPath, false);
            }
           
        }
[+][-]07/19/09 10:24 AM, ID: 24890241Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Microsoft IIS Web Server
Tags: asp.net programming, IIS server
Sign Up Now!
Solution Provided By: Dave_Dietz
Participating Experts: 2
Solution Grade: C
 
[+][-]07/18/09 03:12 AM, ID: 24885478Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/18/09 03:31 AM, ID: 24885516Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/21/09 04:43 AM, ID: 24903340Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/21/09 04:43 AM, ID: 24903348Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/30/09 01:27 AM, ID: 24977690Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20090701_SELECT_ZONES