.htaccess超文本入口文件部分内容-记录

.htaccess文件

<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On    #开启重写
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
</IfModule>
<IfModule mod_headers.c>
  Header add Access-Control-Allow-Origin "https://baidu.com"    #解决跨域问题
  Header set Content-Security-Policy "default-src 'self' data: https://baidu.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' baidu.com https://baidu.com; connect-src 'self' https://baidu.com; img-src 'self' data: hm.baidu.com https://baidu.com; style-src 'self' 'unsafe-inline' baidu.com https://baidu.com;"    #允许资源来源
  Header set X-XSS-Protection "1; mode=block"
  Header set X-Content-Type-Options nosniff
  Header set X-Frame-Options "SAMEORIGIN"
  Header always set Strict-Transport-Security "max-age=63072000;"
  Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
</IfModule>


标签: 记录 htaccess

发表评论: