0

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

am getting this error after rewriting the url as follows in web.config file

<location path="Speakers.aspx">
<system.webServer>
  <httpRedirect enabled="true" destination="localhost/Speakers" httpResponseStatus="Permanent">
    </httpRedirect>
</system.webServer>

2
  • That doesn't look like rewriting to me. That just looks like you're redirecting all traffic to localhost/Speakers. What are you trying to achieve? Commented Aug 5, 2019 at 9:35
  • i want to remove extension from url thats why used this... extension is removed but page doesnot show Commented Aug 5, 2019 at 9:38

1 Answer 1

1

You can use rewrite rules in <system.webServer> like:

<rewrite>
   <rules>        
        <rule name="MyPage" enabled="true">
            <match url="^MyPage/$" />
            <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
            <action type="Rewrite" url="/MyPage.html" />
        </rule>
  </rules>
</rewrite>

The above example would show the content of the MyPage.html page when the user had the URL /MyPage/

Sign up to request clarification or add additional context in comments.

13 Comments

i have tried this. it shows me internal server error on the host
Where in your web.config did you put it? Can you see the actual error? Also, maybe show me the exact code you put in, in case there's an issue with that. It is also possible to add wildcards or use regex to do matches etc.
at the start inside <configuration>
You need to put it inside <system.webServer> as I mentioned above :)
i did as it is but it shows me as: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.