If you want to use the rewrite module, you must first install or load the rewrite module. There are two ways to compile Apache when the direct installation of rewrite modules, not one is compiled Apache in the DSO mode to install Apache, and then
Why do I need to use rewrite rules
----The life of the site is constantly updated and maintained, according to the needs of the business development of the transfer server maintenance, the organization of the directory structure, change the URL or
Example: Rewriteengine on open engine rewriterule test.html/test.php [L] rewriterule test.html?$/tianqi.php?s1=& Amp;s2=&s3 = [qsa,l] for multiple parameters rewriterule tianqi-([0-9]+). html/tianqi.php?id=$1 [L]Note the problem with the path. Text:.
1, open its rewrite module:sudo a2enmod rewrite
2, CONFIGURED to be overridable:Open/etc/apacheOptions FollowSymLinksAllowOverride AllUnder Project directory, create a new. htaccess file, adding the following: Options +followsymlinks
http://10.58.104.19:8008/site/833/3f11d2b44b7d3baa2149f26a30f8c68d/b.js?siteid=332323Convert a static request to a dynamic PHP request
123456789101112131415
Alias /site/home/mahao01/shifen/site_root/"/home/mahao01/shifen/site_root/">
First, make sure that the conf/httpd. conf file in the Apache installation directory is Enabled:
# Code 1 # loadmodule rewrite_module modules/mod_rewrite.so
Then you need to specify the Directory and configuration for implementing the rewrite
This article provides a detailed analysis of the procedure for starting Apache Rewrite in Ubuntu. For more information, see UbuntuApacheRewrite.
Run
Sudo a2enmod rewrite
The Mod_rewrite module is enabled.
In addition, you can
Apache rewrite example setForward one domain name to another in httpdThe VM domain name has recently changed. The new domain name isWww.wbhw.comTo make it easier to remember. In this case, you need to direct the original domain name webhosting-world.
To use the rewrite module, you must first install or load the rewrite module. There are two ways to install the rewrite module directly when compiling apache. The other is to install apache in DSO mode when compiling apache, and then use the source
1. Turn on rewrite
sudo a2enmod rewrite
2. Deactivate rewrite
sudo a2dismod rewrite
3. Server environment variables
The environment variables that Apache provides to the Rewirte module are roughly divided into 5 types.Part I : HTTP headers Partial
1. Remove the WWW tag from the domain name The code is as follows :Rewritecond%{http_host}!^jb51\.net$ [NC]Rewriterule.? Http://jb51.net%{request_uri} [R=301,l]2. Remove the www tag, but save the subdomainThe code is as follows
Here is a method for configuring the whitelist using rewrite Rules in apache.
Today, I got apache rewrite Rules for half a day, but I still haven't configured any matching rules. My colleague gave me some advice and succeeded.
Requirements:Six
The apache rewrite rule has two common tags: [L] and [QSA]. After obtaining pseudo-static data with $ _ GET? The following parameter values must be marked with [QSA.The differences between [L] and [QSA] are as follows:1) 'Last | L' (last rule last)
"Ask" Apache Rewrite path error
The DocumentRoot path to the virtual machine is/VAR/WWW/HTML/DIR1/DIR2
The rewrite rule is written in the. htaccess file.
Rewriteengine onRewritebase/Rewriterule rewrite.html index.php
This time, access is
Apache Rewrite if the file doesn't exist, turn over an address.
Rewrite can make the condition judgment ah.
I want to do this, if a static file (HTML) exists, jump to this address,
Jump to the specified PHP file if it does not exist, but the file
Ask an Apache rewrite rule question
A few days ago I modeled a URL rule wrote a new URL to rule but the previous match was on. html? The following parameters are not in the URL and do not know why
The original URL
PHP Code
Rewriterule ^
Apache Rewrite rule kneel for God help!
Rewriteengine on
Rewritebase/
Rewritecond%{http_host} ^[a-z0-9\-]+\.iecn\.cn$
Rewriterule ^/?$/%{http_host}
Rewriterule ^/([a-z0-9\-]+) \.iecn\.cn/?$/blog.php?u=$1 [L]
I had this rule in. htaccess, and it
Ubuntu14.14 detailed instructions on how to enable Apache RewriteHow to enable the Apache Rewrite function on Ubuntu this article introduces how to enable the urlrewrite function of apache in the ipvtn system. Enabling Apache urlRewrite on Windows
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.