How to Redirect Pages with .htaccess (HTTP to HTTPS, www and 301s)

Websites & Files 1 min read Updated Oct 30, 2026

The .htaccess file in your public_html folder controls redirects on Apache and LiteSpeed web servers. These examples cover the most common needs.

⚠ Back up first Download your existing .htaccess before editing it. A typo can cause a 500 error; restoring the old file fixes it instantly.

Force HTTPS

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]

Remove www

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [L,R=301]

Redirect one page

Redirect 301 /old-page.html https://yourdomain.com/new-page/

Use 301 (permanent) redirects when content has moved for good. They tell search engines to transfer the old page’s ranking to the new address.

Edit .htaccess

Open System Info & Files › File Manager, go to public_html, and edit .htaccess. Files starting with a dot may be hidden; enable “show hidden files” if needed. For simple redirects without code, use Account Manager › Site Redirection.

Frequently asked questions

Should I use www or non-www?

Either works for SEO. What matters is choosing one and redirecting the other to it, so search engines see a single version of each page.

Related articles

Still need help?

Our support team is here for you.

Email: support@crowncityhost.com

Open a ticket