Solved

asp.net RewritePath not working on live server but works on testing server

Posted on 2009-07-14
7
442 Views
Last Modified: 2013-12-25
I have added some .asp pages to our website, but I need them to display .aspx along with the other real .aspx pages.

So I am using RewritePath and an array that take the url ***.aspx and pulls in the ****.asp page.

Everything works perfect on my testing server which is supposed to be an exact match of the live server.

On the liv server I get this error:
Exception information:
    Exception type: HttpException
    Exception message: Path '/***.asp' is forbidden.
Here is my code for the RewritePath
'RewritePath - .aspx page to load .asp content

        Dim originalPath As String = HttpContext.Current.Request.Path.ToLower()

        Dim pageNameArray As New ArrayList()

        pageNameArray.Add("webinars")

        pageNameArray.Add("company-profile")

        pageNameArray.Add("sales-leads")

        pageNameArray.Add("financials")

        pageNameArray.Add("executive-bios")

        

        For i As Integer = 0 To pageNameArray.Count - 1

            If originalPath.Contains(pageNameArray(i).ToString() & ".aspx") Then

                HttpContext.Current.RewritePath(pageNameArray(i).ToString() & ".asp")

            End If

        Nex

Open in new window

0
Comment
Question by:pGustafson
  • 3
  • 2
  • 2
7 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 24852753
I believe you need to enable the module in IIS to rewrite the paths
0
 

Author Comment

by:pGustafson
ID: 24852855
How do I do that
0
 
LVL 28

Accepted Solution

by:
strickdd earned 500 total points
ID: 24853163
Check this site out for detailed information on this topic: http://www.isapirewrite.com/
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Expert Comment

by:sevensnake77
ID: 24854012
You need just to give the file permission just give it read and write permission on the folder this is writing to.
0
 

Author Comment

by:pGustafson
ID: 24858870
The issues was my test server was on IIS 6 and the live server was IIS 5.
0
 

Author Closing Comment

by:pGustafson
ID: 31603411
This was useful information but not the item to resolve my issue.
0
 
LVL 9

Expert Comment

by:sevensnake77
ID: 24859225
Wow  that makes a difference well good luck on your next endeaver
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now