<Files*>Options-indexes</Files><IfmoduleMOD_HEADERS.C><FilesMatch"\. (ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf) $">HeaderSet Cache-control"max-age=2592000, public"</FilesMatch><FilesMatch"\. (xml|txt) $">HeaderSet Cache-control"max-age=604800, public"</FilesMatch><FilesMatch"\. (html|htm|php|shtml) $">HeaderSet Cache-control"max-age=86400"</FilesMatch></Ifmodule><Ifmodulemod_rewrite.c>Options+followsymlinks Rewriteengine on Rewritecond%{request_filename}!-f Rewriterule^ ([a-za-z0-9_]{2,32}\. ( xml|html|txt)) seo.php?file=$1 [L] Rewritecond%{request_filename}!-f Rewritecond%{request_filename}!-d Rewritecond%{request_uri}! (.*)/$# Rewritecond%{request_uri}!\.html$ Rewriterule^ (. *) $/$1/[l,r=301] Rewritecond%{http_host} ^zbphp.com [NC] Rewriterule^ (. *) $ http://www.zbphp.com/$1 [l,r=301] Rewritecond%{http_host}!^ (loc|localhost|devwww|192.168.) [NC] Rewritecond%{http_host}! (zbphp.com) $ [NC] Rewriterule^ (. *) $ http://www.zbphp.com/$1 [l,r=301] Rewritecond%{request_filename}!-d Rewritecond%{request_filename}!-f Rewriterule^ (. *) $ index.php/$1 [qsa,pt,l]</Ifmodule> #兼容网站 zbphp.com, work.zbphp.com, admin.zbphp.com all point to the same directory program #implementation:#如果是zbphp. com access, jump directly to www.zbphp.com/$1# if it is my.zbphp.com, test.zbphp.com do not jump # if it is localhost, 192.168.*.*, loc, DEVWWW Local test environment, do not jump # all other jumps
ThinkPHP3.2 multi-domain Virtual htaccess match rewritecond%{http_host}