Some directories are for users who do not need access
For example:
[Email protected] ~]# cd/data/www
[Email protected] www]# mkdir tmp/
[Email protected] www]# CD tmp/
[[email protected] tmp]# ls
[Email protected] tmp]# vim 12.txt
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/88/4D/wKiom1fuE8zC4og7AACrXCoxML8182.jpg "title=" Dis24.jpg "alt=" Wkiom1fue8zc4og7aacrxcoxml8182.jpg "/>
At this point, the file/data/www/tmp/12.txt is normally accessible.
Now I have a requirement that there are some important files in this folder that you do not want to see for the user.
Or this module, note the Red font part
[Email protected] ~]# vim/usr/local/apache2/conf/extra/httpd-vhosts.conf
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritecond%{http_host} ^www.aaa.com$ [or]
Rewritecond%{http_host} ^www.bbb.com$
Rewriterule ^/(. *) $ http://www.test.com/$1 [r=301,l]
# Rewritecond%{http_user_agent} ^.*curl.* [nc,or] #NC mean not to distinguish the size, the same
Rewritecond%{http_user_agent} ^.*chrome* [NC]
Rewriterule. *-[F]
Rewritecond%{request_uri} ^.*/tmp/.* [NC]
Rewriterule. *-[F]
[Email protected] ~]# apachectl-t
Syntax OK
[Email protected] ~]# apachectl restart
Visit the website again, site 403, no access.
Http://www.test.com/tmp/12.txt
650) this.width=650; "Src=" http://s5.51cto.com/wyfs02/M00/88/4E/wKiom1fuG72Cwl1FAADTi7DWr2Q148.jpg " Title= "Dis25.jpg" alt= "Wkiom1fug72cwl1faadti7dwr2q148.jpg"/>
This article is from the "Cbo#boy_linux Road" blog, make sure to keep this source http://20151213start.blog.51cto.com/9472657/1858145
Rewrite limitations of 7_apache configuration