1. Add www tags to subdomainsRewritecond%{http_host} ^ ([A-Z.] +)? example\.com$ [NC] Rewritecond%{http_host}!^www\. [NC] Rewriterule.? Http://www.%1example.com%{request_uri} [R=301,l]
This rule crawls the%1 variable of level two domain name, if not
RewriteCond, RewriteRule, and rewrite logs in apacheOverview
?? The main function of Rewirte is to implement URL redirection. It can be based on the server-level (httpd. conf) and directory-level (. htaccess) methods. To use the rewrite module, you
Rewirte basic function is to implement the URL of the jump and hide the real address, based on the Perl language of the canonical table specification. Usually help us achieve quasi-static, quasi-folder, domain name jump, prevent hotlinking and so on.
About. htaccess use of pseudo-static, Zhangrong insects have not been well thought of. Used to be on the Internet to find ready-made, and then modify the next URL to implement redirection. Today, I looked for information specifically about the
Apache URL rewrite rewriterule parameters in detailWe often do some rewriting of some URLs over Apache, so there are a lot of options for rewriting strategies, such as how to redirect, how to handle parameters, the order in which rules are
One opens the Apache configuration file httpd.conf.
Two will #loadmodule Rewrite_module Modules/mod_rewrite front of the # Remove
Three Add in httpd.conf:
Rewriteengine on
#RewriteCond%{env:script_url} (?: Index|dispbbs) [ -0-9]+\.html
Rewriterule ^
# #-Represents a comment at the beginning of a line. [F]--forbidden (Forbidden): The command server returns 403 Forbidden error to the user's browser [l]--last rule (last rule): tells the server to stop rewriting the URL after this rule has finished
Article Title: describes the application of Apache rewrite rules. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open
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.