Quick Answer
htaccess is an Apache config file for directory-level settings. In PHP apps: enable URL rewriting (route all requests to index.php), block direct access to sensitive files, set PHP ini values, add security headers, and redirect HTTP to HTTPS. Essential for clean URLs in frameworks. Nginx uses server config files instead of htaccess. htaccess is read on every request so keep it lean.
Answer
.htaccess configures Apache: URL rewriting, security rules, redirects, and access control per directory.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.