Web Hosting General

What is the .htaccess file and what are the most useful rules for WordPress?

.htaccess is a per-directory Apache configuration file that controls redirects, rewrites, access control, PHP settings, and caching headers without server-level access. For WordPress, the most important rules: 1) WordPress permalink rewriting (auto-added by WordPress — enables clean URLs): RewriteRule . /index.php [L]. 2) Force HTTPS: RewriteCond %{HTTPS} off, RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]. 3) Block WordPress xmlrpc.php: <Files xmlrpc.php>, Order Allow,Deny, Deny from all, </Files>. 4) Protect wp-config.php: <Files wp-config.php>, Deny from all, </Files>. 5) Block bad bots: RewriteCond %{HTTP_USER_AGENT} (scrapy|python-requests) [NC], RewriteRule .* - [F,L]. 6) Set cache headers for static files: <FilesMatch ".(jpg|css|js)$">, Header set Cache-Control "max-age=2592000". Edit .htaccess in Connect Quest cPanel File Manager. Always backup before editing.

Need more help? Our experts are available 24/7.

Visit ConnectQuest → 📞 +91 2269711150
Serving North East India
Assam · Guwahati Meghalaya · Shillong Nagaland · Kohima Arunachal Pradesh · Itanagar Manipur · Imphal Tripura · Agartala Mizoram · Aizawl Sikkim · Gangtok
Professor Conquest Connect Quest AI Assistant
Press Enter to send • Response time: 10-15 seconds