Webmaster Tools Suite

by pcplayer.site

.htaccess Generator

Enter one rewrite rule per line. Example: RewriteRule ^old-page$ /new-page [R=301,L]

Enter one error document per line in format: error_code path_to_file

Enter three lines: 1) AuthName, 2) Path to .htpasswd file, 3) Space-separated usernames

About .htaccess Files

The .htaccess (hypertext access) file is a configuration file for use on web servers running the Apache Web Server software.

Common uses:

  • URL rewriting (clean URLs, redirects)
  • Custom error pages (404, 500, etc.)
  • Password protection for directories
  • Blocking IP addresses or user agents
  • Setting MIME types
  • Enabling CORS headers

Important notes:

  • Only works on Apache servers (not Nginx, IIS, etc.)
  • Changes take effect immediately (no server restart needed)
  • Incorrect rules can break your website
  • For security, avoid exposing .htpasswd files
  • For performance, consider moving rules to main server config