Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when trying to do URL rewriting 1

Status
Not open for further replies.

adam0101

Programmer
Jun 25, 2002
1,952
US
I'm trying to implement the URL rewriting technique found here to basically rewrite a URL from this:
[tt][/tt]
to this:
[tt][/tt]

It worked for a little bit, but now I get this error that points to my web.config file:

Code:
[b]Description:[/b] An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

[b]Parser Error Message:[/b] It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

[b]Source Error: [/b]


Line 60:            by Microsoft that offers a single logon and core profile services for member sites.
Line 61:     -->
Line 62:     <authentication mode="Windows" /> 
Line 63: 
Line 64:

I think what's happening is that the application thinks there's a duplicate web.config in a subdirectory when in fact it's the same directory. I'm at a loss as to how I can fix this. Does anyone have any insight into this problem?

Thanks,

Adam
 
Nevermind, I got it. I needed to add the file extension of the url I wanted to rewrite to my regular expression. It must have been matching too much or something. So for anyone else using the URL rewriting techique from that site, here's what I did. I changed this:
Code:
<rule>
  <url>/MyProj/(TypeXXX|TypeYYY)/(.*)\?(.*)</url>
  <rewrite>/MyProj/$2?$3&amp;type=$1</rewrite>
</rule>
To this:
Code:
<rule>
  <url>/MyProj/(TypeXXX|TypeYYY)(.*)\[b].aspx[/b]\?(.*)</url>
  <rewrite>/MyProj/$2[b].aspx[/b]?$3&amp;type=$1</rewrite>
</rule>

Adam
 
Thanks for the tip!


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top