How to set the URL rewrite

Source: Internet
Author: User
URL rewrite requires support from the server! Before enabling this setting, make sure that the correct settings are made on the server, see "Settings under Apache" below and "Setup methods under IIS" below!
How to set up under Apache

Copy the Code code as follows:


Open the Apache configuration file httpd.conf.
Remove the #loadmodule rewrite_module modules/mod_rewrite the front #
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 implement the mapping of ASP post URLs to PHP posts, add between the third step and the following:
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 describes the URL rewrite settings, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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