2023-04-18發表Apache幾秒讀完 (大約62個字)htaccess 301 轉址利用mod_rewrite功能修改如下:1234567891011# 以下兩行不可省略Options +FollowSymLinksRewriteEngine on# 將index.php 轉到 /RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/RewriteRule ^(.*)index\.php$ /$1 [R=301,L]# 將沒有www 轉到有 wwwRewriteCond %{HTTP_HOST} ^domain.com [NC]RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
2023-04-18發表Apache3 分鐘讀完 (大約398個字)Enable GZIP Compression in Apache編輯http.conf1vim /etc/httpd/conf/httpd.conf檢查是否有載入以下模組123LoadModule deflate_module modules/mod_deflate.soLoadModule headers_module modules/mod_headers.soLoadModule filter_module modules/mod_filter.so繼續閱讀
2022-08-24發表Apache幾秒讀完 (大約77個字)Apache設定HSTS1. 開啟apache headers模組1sudo a2enmod headers2. 重新啟動apache server繼續閱讀