Setting method of URL rewrite _php tips

Source: Internet
Author: User
URL rewrite need server support! Before you enable this setting, make sure that the correct settings have been made on the server, and see the settings method under Apache and the settings under IIS below.
the setting method under Apache
Copy Code code as follows:

Open the Apache configuration file httpd.conf.
Remove the #loadmodule rewrite_module modules/mod_rewrite front
Add 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 implement the mapping of ASP post URLs to PHP posts, add in the third step between <ifmodule mod_rewrite.c> and </IfModule>:
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.

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.