A question about pseudo-static, suddenly forget a piece of code
I want to achieve such an effect: When the index.html exists, the access to the existence of the index.html file, does not exist, the pseudo-static to go through dynamic access, configured as follows:
Rewriteengine on
Rewritecond%{http_host} ^ (. *) www.aaa.com$ [OR]
Rewritecond%{http_host} ^ ([^www]*). aaa.com$
Rewritecond%{document_root}%{request_filename}!-f
Rewriterule ^ (. *) $ http://www.aaa.com.$1 [r,qsa,l]
Rewriterule ^/([a-za-z]+) \.html$/run.php?controller=$1&action=$1&default=1 [L]
ServerAdmin [email protected]
DocumentRoot "E:/www/home"
ServerName www.aaa.com
Errorlog "D:/appserv/log/index_error.log"
Customlog "D:/appserv/log/index_access.log" common
ErrorDocument 404 http://www.aaa.com/error_404.html
ErrorDocument 403 http://www.aaa.com/error_403.html
Options Indexes FollowSymLinks
DirectoryIndex index.html
AllowOverride None
Order Deny,allow
Allow from all
But the above configuration has a problem, when the index.html exist, the system also through pseudo-static access, help.
I am sure that the effect I am going to do is achievable, I have done this before, and then I lost my configuration, and I can't think of what I wrote wrong.
Help, thank you.
------Solution--------------------
#如果目录存在就直接访问目录不进行RewriteRule
Rewritecond%{request_filename}!-d
#如果文件存在, the file is accessed directly without the following rewriterule. (Do not overwrite if file or file does not exist)
Rewritecond%{request_filename}!-f
------Solution--------------------
Learn ...