Custom .htaccess Rules for Advanced Configuration Print


The .htaccess file allows you to control many Apache settings for your site.

Common Uses:

  • Force HTTPS:
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • Redirect URLs:
    Redirect 301 /old-page.html /new-page.html
  • Block IPs:
    deny from 123.456.789.000

Note: Make a backup before editing .htaccess. Errors can cause site issues.


Was this answer helpful?

Related Articles

How to Use SSH Access on Shared Hosting SSH (Secure Shell) provides encrypted command-line access to your hosting account — ideal for... Managing Cron Jobs in cPanel Cron Jobs allow you to automate repetitive tasks like running scripts at set intervals. Steps to... Using Git Version Control in cPanel Track changes and deploy code efficiently using Git from your Aviumshost cPanel. Create a Git... PHP Configuration Overrides (php.ini & .user.ini) You can customize PHP settings like memory limit or max upload size without needing root access.... How to Enable Two-Factor Authentication for cPanel Two-Factor Authentication adds an extra layer of security to your hosting account, preventing...
« Back