RevealTheme logo

.htaccess 스니펫 생성기

일반적인 .htaccess 규칙을 생성합니다: HTTPS 강제, www 리디렉션, 캐시 헤더 설정, Gzip 활성화.

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

이 도구 사용 방법

  1. 1

    Open the dropdown and choose the rule you need (for example, Force HTTPS or Gzip compression).

  2. 2

    Read the generated snippet shown in the code box below the dropdown.

  3. 3

    Select the text and copy it, then paste it into your site's .htaccess file.

  4. 4

    Switch the dropdown to a different rule to view another snippet — combine several by pasting them one after another.

.htaccess 스니펫 생성기란 무엇인가요?

.htaccess는 Apache의 디렉터리별 구성 파일입니다. URL 재작성, 리디렉션, 캐싱, 압축, 보안 헤더를 제어합니다. Hostinger와 대부분의 공유 호스팅은 Apache(또는 호환되는 LiteSpeed)를 사용합니다. 이 스니펫들은 가장 일반적인 필요 사항을 다룹니다.

일반적인 사용 사례

  • Forcing every visitor onto HTTPS after installing an SSL certificate on a shared Apache or LiteSpeed host.

  • Canonicalizing a domain to either the www or non-www version with a 301 redirect to consolidate SEO signals.

  • Adding a one-year browser cache to static assets so repeat visitors load CSS, JS, and modern image formats from cache.

  • Turning on Gzip compression for text responses to cut transfer size and improve page load time.

  • Hiding the contents of a folder that has no index file by disabling Apache's automatic directory listing.

  • Blocking PHP execution inside a public uploads directory so an attacker can't run a script they managed to upload.

자주 묻는 질문

.htaccess가 Nginx에서도 작동하나요?
아닙니다: Nginx는 자체 구성 구문을 사용합니다. 이 스니펫들은 Apache/LiteSpeed 전용입니다.
.htaccess를 어디에 두어야 하나요?
사이트의 루트(index.html 옆)에 둡니다. 규칙은 해당 디렉터리와 모든 하위 디렉터리에 적용됩니다.

관련 도구