Apache rewrite_module pseudo static and Order allow, deny IP

Source: Internet
Author: User
Tags php tutorial

Apache rewrite_module pseudo static and order allow, deny ip
1. Open the configuration file httpd. conf of apache.
2. Remove the # loadmodule rewrite_module modules/mod_rewrite before #.
3. Add the following in httpd. conf:

<Ifmodule mod_rewrite.c>
Rewriteengine on


# Rewritecond % {env: script_url }(? : Index | dispbbs00000000-0-900000000.html
Rewriterule ^ (.*? (? : Index | dispbbs00000000-(-0-942500000000.html $ {getproperty (content)}. php Tutorial? _ Is_apache_rewrite = 1 & __ rewrite_arg = $2
</Ifmodule>

4. To map asp post URLs to php posts, add the following between <ifmodule mod_rewrite.c> and </ifmodule> in Step 3:
   

Rewritemap tolowercase int: tolower
Rewritecond % {query_string }(? : Boardid | page | id | replyid | star | skin) = d + [nc]
Rewriterule ^ (.*(? : Index | dispbbs). asp $ {getproperty (content)}. php? $ {Tolowercase: % {query_string }}&__ is_apache_rewrite = 1

5. Save httpd. conf and restart apache

Apache ip address sealing method

1. Set in the configuration file:

Open httpd. conf and edit the following blocks:

[Code] httpd. conf
 

<Directory "/var/www/html"> options indexes followsymlinks allowoverride none order allow, deny allow from all deny from 124.114.0. deny from 124.115.0. </directory> [code]. create or open an htaccess file in the root directory of the website. add the following content to the htaccess file)

 

Order allow, deny allow from all deny from 124.114.0. deny from 124.115.0.

 

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.