เครื่องกำเนิด Htaccess

โปรแกรมสร้าง .htaccess ออนไลน์ฟรี และ Apache Configuration Studio

สร้างไฟล์การกำหนดค่า Apache .htaccess แบบกำหนดเองด้วยการเปลี่ยนเส้นทาง HTTPS, กฎ WWW/ไม่ใช่ WWW, การแคชของเบราว์เซอร์, การบล็อก IP และตัวเลือกความปลอดภัยแบบเรียลไทม์

ค่าที่ตั้งล่วงหน้าด่วน:

1. การเปลี่ยนเส้นทางและกฎโดเมน

2. ความปลอดภัยและการควบคุมการเข้าถึง

Prevents visitors from seeing directory folder contents when no index file exists.

Mitigates clickjacking, MIME sniffing, and XSS vulnerabilities via mod_headers.

Supports Apache 2.4 (Require not ip) with automatic fallback for Apache 2.2.

4. ประสิทธิภาพ แคช และการบีบอัด

Instructs browsers to cache static assets locally to reduce server bandwidth.

Compresses text, HTML, CSS, JS, and JSON data before sending it over the wire.

Routes all non-file/non-directory requests to /index.html for React, Vue, or Next export SPAs.

3. หน้าข้อผิดพลาดที่กำหนดเอง

สร้างเอาต์พุต .htaccess

.htaccess
# ================================================================
# Apache .htaccess Configuration File
# Generated by Tool 200 (https://tool200.com/htaccess-generator)
# 100% Client-Side Free .htaccess Generator
# ================================================================

# Disable directory file browsing
Options -Indexes

# Rewrite Engine Settings
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Force HTTPS Redirection
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Redirect www to non-www
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [L,R=301]

</IfModule>

# Custom Error Documents
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html

# Essential Security Headers
<IfModule mod_headers.c>
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-Content-Type-Options "nosniff"
    Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# Leverage Browser Caching (Expires Headers)
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 month"

    # HTML document: don't cache or short cache
    ExpiresByType text/html "access plus 0 seconds"

    # CSS and JavaScript: 1 month
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"

    # Images & Favicons: 1 year
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/webp "access plus 1 year"
    ExpiresByType image/svg+xml "access plus 1 year"

    # Web Fonts: 1 year
    ExpiresByType font/ttf "access plus 1 year"
    ExpiresByType font/woff "access plus 1 year"
    ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

# Gzip / Deflate Compression
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
    AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
    AddOutputFilterByType DEFLATE application/json application/xml application/rss+xml
    AddOutputFilterByType DEFLATE image/svg+xml font/ttf font/otf
</IfModule>
ประมวลผล 100% ในเบราว์เซอร์ของคุณ ไม่มีการสื่อสารหรือการบันทึกเซิร์ฟเวอร์

เหตุใดจึงใช้เครื่องมือ 200 เครื่องมือสร้าง .htaccess ออนไลน์ฟรี

ปรับความเร็วเว็บเซิร์ฟเวอร์ Apache ให้เหมาะสม บังคับใช้ HTTPS และโดเมนมาตรฐานที่ปลอดภัย ใช้ประโยชน์จากแคชของเบราว์เซอร์ และปกป้องไดเร็กทอรีที่ละเอียดอ่อนด้วยการรักษาความปลอดภัยบนเบราว์เซอร์ 100%

HTTPS และการเปลี่ยนเส้นทาง Canonical ที่ไร้รอยต่อ

บังคับใช้การรับส่งข้อมูล HTTPS และเลือกระหว่างการปรับมาตรฐานโดเมน WWW และที่ไม่ใช่ WWW ได้อย่างง่ายดายโดยใช้กฎ mod_rewrite ที่ได้รับการพิสูจน์แล้ว

ใช้ประโยชน์จากแคชและการบีบอัดเบราว์เซอร์

เปิดใช้ส่วนหัว mod_expires และการบีบอัด mod_deflate gzip เพื่อเพิ่มความเร็วในการโหลดเนื้อหาอย่างมากและปรับปรุง Google Core Web Vitals

การรักษาความปลอดภัยเว็บที่แข็งแกร่งและการป้องกัน IP

ปิดการใช้งานดัชนีไดเรกทอรี (รายการ) จำกัดที่อยู่ IP ที่ไม่ต้องการ และกำหนดค่าหน้าข้อผิดพลาดแบบกำหนดเอง (404, 500) โดยไม่มีการส่งข้อมูลเซิร์ฟเวอร์

พักสมองอย่างรวดเร็ว

ลองเล่นมินิเกมคลายเครียดสักหน่อยไหม?

ต้องการฟื้นฟูจิตใจ 2 นาทีใช่ไหม? กระโดดเข้าสู่เกมปริศนาสุดคลาสสิกในเบราว์เซอร์ของคุณ