Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Posted on 2009-07-14
Medium Priority
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()
        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

Open in new window

Question by:pGustafson
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
LVL 28

Expert Comment

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

Author Comment

ID: 24852855
How do I do that
LVL 28

Accepted Solution

strickdd earned 1500 total points
ID: 24853163
Check this site out for detailed information on this topic: http://www.isapirewrite.com/
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Expert Comment

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

Author Comment

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

Author Closing Comment

ID: 31603411
This was useful information but not the item to resolve my issue.

Expert Comment

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

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

610 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