GeneratorsLesson 55Free preview
.htaccess Generator
This lesson is part of Web Developer Tools · All levels
Summary
The generator makes configuration pieces for Apache servers at the directory level. The general rules include redirects, HTTPS enforcement, URL rewriting, custom page errors, and security header. Since syntax errors can cause error sites, test changes in the local environment first. (.htaccess)
Key points
- .htaccess is only read by Apache servers and relies on AllowOverride
- RewriteEngine On required before the rule rewrite
- 301 redirect is used for permanent displacement
- ErrorDocument specifies a specific error page
- Always back up the files and test the rules before applying them to production
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.