apache下的Zend Framework转跳同时忽略指定目录

Standard
<Location />
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule !.(js|ico|gif|jpg|jpeg|pdf|png|css)$|.*(yemaosheng_com|DirectoryName).* /index.php
</Location>

另一个其它框架的转跳

# if the yemaosheng_com directory exists, then let apache handle it.
RewriteCond %{REQUEST_URI} ^/yemaosheng_com/.*$
  RewriteRule (.*) $1 [L]
 
   # if the file exists, then let apache handle it.
   # index.php should be the only php available for direct access.
    RewriteCond %{DOCUMENT_ROOT}/%{SCRIPT_FILENAME} -f
      RewriteRule (.*) $1 [L]
   # else processit specially
      RewriteRule (.*) /index.php?$1 [L]

访问指定的目录时转跳并保持原来域名

RewriteCond %{REQUEST_URI} /news/     [NC]
RewriteRule ^.*$     http://yemaosheng.com/blog/ [P,L]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.