redirect all of old website pages to new sites index page

Avatar
  • Answered
I need to redirect all page links to old website to new websites index page. Redirect hasn't worked for this issue.
Avatar
JacobIMH
Hello, and thank you for your question. If you are interested in redirecting all pages from an old domain to a new one, you can do so with a 301 redirect in your .htaccess file. Specifically for your case, if your old site was example.com, and your new site was example.net, you could use the following rewrite rules to permanently redirect everything.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]
Please let us know if you're having any issues at all getting this to work on your website and we'd be glad to assist you. - Jacob