Apache rewriterule Technology

Source: Internet
Author: User

The configuration process is as follows:

 

Apache enables the following modules:

Loadmodule proxy_module modules/mod_proxy.so

Loadmodule proxy_http_module modules/mod_proxy_http.so
Loadmodule rewrite_module modules/mod_rewrite.so

 

Add the following statements to the configuration file:

<Proxy *>
Order deny, allow
Allow from all
</Proxy>

 

Find

<Directory/>
Options followsymlinks
AllowOverride none
Order deny, allow
Deny from all
</Directory>

 

Change none to all

 

Find

<Directory "D:/web/Apache/htdocs">

 

......

 

AllowOverride none

 

......

 

</Directory>

 

Change none to all.

 

Enable PHP:

 

Loadmodule php5_module D:/web/PHP/php5apache2_2.dll
Phpinidir D:/web/PHP
Addtype application/X-httpd-PHP. php

 

Try to create a. htaccess file in the root directory of the website. It cannot be created in Windows. The method is unknown!

 

As follows:

Rewriteengine on
Rewritebase/
Rewriterule ^ (/d {1, 6}) ([SB] {1}) _ (/W + )_. */. BMP $ http: // localhost/plus/getsimg. PHP? Id = $1 & imgtype = $2 & pingyinname = $3 [l]
Rewriterule ^ (/d {1, 6}) _. */. SWF $ http: // localhost/plus/getflash. php? Id = $1 [l]
Rewriterule ^ (/d {1, 3}) _ (/d {1, 3}) _ (/d {1, 3}) _/W * _ (/W *) /. HTML $ http: // localhost/plus/redirect. PHP? Cid = $1 & totalresult = $2 & pageno = $3 & pingyinname = $4 [p]
Rewriterule ^ (/d {1, 3}) _/W + _ (/d {1, 6}) _/W + /. HTML $ http: // localhost/plus/redirect. PHP? Cid = $1 & Aid = $2 [p]
Rewriterule ^ (/d {1, 3}) _/W * _ (/W *)/. html $ http: // localhost/plus/redirect. php? Cid = $1 & pingyinname = $2 [p]
Rewriterule ^ special_game _ [^ _] * _ (_. *) _ (/d {1, 4})/. html $ http: // localhost/plus/to_tags_php.php? /$1/$2/[p]

 

It involves regular expressions. Regular Expressions are a little troublesome and take time to study! You can override the above steps...

 

 

 

 

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.