URL Rewrite requires server support! Before enabling this setting, please make sure that the correct settings have been made on the server. For the setting method, please refer to the "Setting Method under Apache" and "Setting Method under IIS" below!
Setting method under Apache
Copy the code The code is as follows:
Open the Apache configuration file httpd.conf.
Remove the # in front of #LoadModule rewrite_module modules/mod_rewrite
Add in httpd.conf:
RewriteEngine On
#RewriteCond %{ENV:SCRIPT_URL} (?:index|dispbbs)[ -0 -9]+.html
RewriteRule ^(.*?(?:index|dispbbs))-([-0-9]+).html$ $1.php?__is_apache_rewrite=1&__rewrite_arg=$2
To realize the mapping of asp post URL to php post, add between
RewriteMap tolowercase int:tolower
RewriteCond %{QUERY_STRING} (?:boardid| page|id|replyid|star|skin)=d+ [NC]
RewriteRule ^(.*(?:index|dispbbs)).asp$ $1.php?${tolowercase:%{QUERY_STRING}}&__is_apache_rewrite=1
Save httpd.conf and restart Apache.
The above introduces the setting method of URL Rewrite, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.