x625802392 发表于 2018-11-18 07:04:18

.htaccess中的apache rewrite规则详解

  .htaccess中的apache rewrite写法:
  RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?xxx.com$
RewriteCond %{REQUEST_URI} !^/blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /blog/$1
没有输入文件名的默认到到首页
  RewriteCond %{HTTP_HOST} ^(www.)?xxx.com$
RewriteRule ^(/)?$ blog/index.php



页: [1]
查看完整版本: .htaccess中的apache rewrite规则详解