Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to change the aspx file format to html statically using URLRewriter

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article is about how the aspx file format can be statically transformed into html using URLRewriter. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Use asp.net to develop web programs and use URLRewriter.dll to achieve static.

a. Download URLRewriter.rar, decompress it and put it in the / bin/ directory

b. Add URLRewriter.rar to the project reference.

c. Configure the IIS site with the extension html to point to the handler aspnet_isapi.dll.

IIS site-> Properties-> Home Directory-> configuration-> add

Executable files are the same as aspx processing, both are c:\ windows\ microsoft.net\ framework\ v2.0.50727\ aspnet_isapi.dll

Be careful not to choose to check the existence of the file.

d. Add configuration content to web.config, which is available in the zip file.

The copy code is as follows:

~ / (\ d*) .html

~ / user/default.aspx?link=$1

e. Enter [url] http://localhost/1.html[/url] in the address bar to point to [url] http://localhost/user/default.aspx?link=1[/url]

Configuration of static Apache Web Server based on Apache HTTP Server (conf/httpd.conf)

a. Find LoadModule rewrite_module modules/mod_rewrite.so in the httpd.conf file

Usually the line is commented and the "#" is removed. If not, add the line.

b. Add the code:

The copy code is as follows:

RewriteEngine On

RewriteRule ^ / ([0-9] +) .html$ / user.php?user=$1

c. If the website is defined through a virtual host, be sure to add it to the virtual host configuration file. htccess, otherwise it is possible

Cannot be used.

d. Restart Apache and reload the configuration.

e. Enter [url] http://localhost/1.html[/url] in the address bar and actually point to [url] http://localhost/user.php?user=1[/url]

Thank you for reading! On "aspx file format how to use URLRewriter to achieve static into html" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it out for more people to see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report