URL rewrite setting method

Source: Internet
Author: User

URL rewrite requires support from the server! Before Enabling this setting, make sure that the correct settings have been made on the server. For the setting method, see "setting methods under Apache" and "setting methods under IIS" below "!
Configuration method in Apache
CopyCode The Code is as follows: Open the Apache configuration file httpd. conf.
Remove the # loadmodule rewrite_module modules/mod_rewrite before #.
Add the following in httpd. conf:
<Ifmodule mod_rewrite.c>
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
</Ifmodule>

To map ASP post URLs to PhP posts, add the following between <ifmodule mod_rewrite.c> and </ifmodule> in step 3:
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.