Hi,
domain name+ page.
url enter on browser .
how to add rule root level web config file.
kindly help me.
Hi,
domain name+ page.
url enter on browser .
how to add rule root level web config file.
kindly help me.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sandhiya PriyaPosted Sep 30, 2026, 6:24 AM
Hi,
If you want to add a URL rewrite rule at the root level in
web.config, you can use the IIS URL Rewrite module.For example, if you want:
https://domain.com/oldpage.aspxto redirect to:
https://domain.com/newpage.aspxyou can add this inside the
section:The
web.configshould be placed in the root directory of the application.Make sure the IIS URL Rewrite module is installed on the server. Also, if you share the exact URL you want to redirect and the expected URL, the rule can be written specifically for your case.
RamitPosted Sep 23, 2026, 6:33 PM
If you want a URL like:
https://www.example.com/page
to open a specific page, you can add a URL rewrite rule in the root web.config file.
Notes:
Add the rule in the root
web.config.Ensure the URL Rewrite Module is installed in IIS.
Replace
/Pages/MyPage.aspxwith your actual page path.Use Rewrite if you want the browser URL to remain
/page.Use Redirect if you want the browser URL to change to the target page
Tuhin PaulPosted Aug 6, 2026, 1:02 PM
If you want a URL like:
to open a page using a root-level
web.configin an ASP.NET application, you can add a URL Rewrite rule.Example
Browser URL:
Internally loads:
Or, if you want to redirect instead of rewrite:
Can you tell me:
ASP.NET Web Forms, ASP.NET MVC, or ASP.NET Core?
What is your desired URL (e.g.,
/about) and what page should it open (e.g.,About.aspx)?sushil kumarPosted Aug 5, 2026, 6:30 AM
If you want to add a rule in the root-level
web.config(typically for URL Rewrite, redirects, security headers, etc.), you add it under thesection.Example: Redirect HTTP to HTTPS
url="https://{HTTP_HOST}/{R:1}"
redirectType="Permanent" />
Example: Redirect Old URL to New URL
url="/newpage"
redirectType="Permanent" />
Example: Block Specific IP
Example: Add Security Headers
For ASP.NET Core Applications
The root
web.configoften looks like this:path=""
verb=""
modules="AspNetCoreModuleV2"
resourceType="Unspecified" />
arguments="MyApp.dll"
stdoutLogEnabled="false"
hostingModel="InProcess" />
To add rewrite rules, place them inside the same
section:...