Zend伪静态实现

  RewriteEngine On
RewriteRule ^([-a-zA-Z0-9]+)/.html$ /$1/  [L]
RewriteRule ^([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)/.html$ /$1/$2/  [L]
RewriteRule ^([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)/.html$ /$1/$2/$3/ [L]
RewriteRule !/.(js|ico|gif|bmp|jpg|png|css|xml|htm|txt)$ index.php [NC]

 

 

或者

 

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^([-a-zA-Z0-9]+)/.html$ /$1/  [L]
RewriteRule ^([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)/.html$ /$1/$2/  [L]
RewriteRule ^([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)_([-a-zA-Z0-9]+)/.html$ /$1/$2/$3/ [L]
RewriteRule ^.*$ /index.php [NC,L]

 

 

bootstrap.php中添加

 if (! empty ( $_SERVER ["REDIRECT_URL"] )){ $_SERVER ["REQUEST_URI"] = $_SERVER ["REDIRECT_URL"]; }

你可能感兴趣的:(ZendFramework,zend,redirect,server,url,xml,css)