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.
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:...