Where should HTTPS and non-www rules go in my .htaccess file?

November 13, 2026 1 answer
Asked by mildly-untallied

I have an existing .htaccess file with a redirect and some site builder rewrite rules. I want to redirect HTTP to HTTPS and remove www from the host.

Do I need to put my domain name in those rules, and does HTTPS have to come first? I'm also wondering what other effects changing the order might have.

Answers

c247+foldmark_9

Keep an eye on links after the host change. Absolute links, canonical tags, and any application settings that contain the old host may still point visitors there, even if the redirect catches them.

Relative links generally don't need a host change, but test the builder's page routes too. An external redirect changes the address in the browser, while the builder rules can rewrite a request internally to a different file.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions