• Home
  • About Us
  • Digital Marketing Terms
  • Local SEO Services
  • SEO Consulting
  • WordPress Speed
  • Contact Us
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yooter

WordPress Tutorials, Local SEO Consulting

  • WordPress General
  • Divi Builder Tutorials
  • WordPress Plugins
  • Local SEO
  • Show Search
Hide Search
You are here: Home / WordPress Code / How To Redirect An Entire Website Using htaccess

How To Redirect An Entire Website Using htaccess

Aaron James · September 23, 2020 · Leave a Comment

There are numerous way to program a redirect using the .htaccess file. However, we found it difficult to find code that actually redirects an entire website. No matter what the user types in from the URL bar, this script accomplishes how to redirect an entire website to a new website. Insert the following code in your .htaccess file. Be sure to delete any unnecessary white space from the top or bottom of the file. Let us know how it works in the comments below.

RewriteEngine on
RewriteCond %{http_host} ^www.oldsite.com [NC,OR]
RewriteCond %{http_host} ^oldsite.com [NC]
RewriteRule ^(.*)$ https://newsite.com/ [R=301,NC,L]

 

Filed Under: WordPress Code

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • Divi Builder Not Working With Cloudflare CDN
  • Divi Visual Builder Not Saving Changes
  • How to Fix The Jumping Header Issue Divi Builder
  • How To Fix WordPress Editor Updating Failed
  • Common Divi Builder Breakpoints For Devices
  • How To Use Google Reverse Image Search
  • How To Install Google Analytics 4 In 7 Easy Steps
  • Can’t Change The WordPress Admin Email Address
  • The Importance of SEO
  • Outdoor Quarantine Activities For Your Team

Featured Service

local seo services

Local SEO Services

With more than 15 years of search engine marketing  experience, Yooter is a local SEO services company that strategically optimizes websites for small to medium-sized businesses. Local SEO services … Learn More about Local SEO Services

Archives

  • March 2021
  • January 2021
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • March 2020
  • October 2019
  • September 2019
  • May 2019

Categories

  • Digital Marketing
  • Digital Marketing During Covid-19
  • Digital Technology
  • Divi Builder Resources
  • Divi Builder Tutorials
  • Gravity Forms
  • Gravity Forms Snippets
  • Local SEO
  • Social Media Marketing
  • Social Media Trends 2021
  • Uncategorized
  • WooCommerce Snippets
  • WordPress Code
  • WordPress Experts
  • WordPress Plugins
  • WordPress Technology
  • WordPress Themes
  • WordPress Troubleshooting

Specialty Areas

  • SEO Experts
  • Lehigh Valley Web Design
  • Philadelphia SEO Services
  • SEO Audit Services
  • Ad Agency Reviews
  • PPC Management Agency
  • What Is Social Media Marketing?

Copyright © 2021 · Yooter - A Search Engine Marketing Agency