April 13, 201511 yr So I'm going to be moving a website to a new domain in the near future and I know we need to set up redirects on most of the pages for SEO purposes, but it's sort of a tricky situation. I'm not familiar enough with .htaccess code to understand how to do what I need it to do. Could someone help me write the proper redirects? I'm moving a website to a new domain name, but we are putting up a new website at the current domain name as well, so we can't do a full domain redirect. I need to redirect all directories and pages to the same directories/pages on the new domain. Something like this: currentdomain.com/about-us/ -> newdomain.com/about-us/ currentdomain.com/about-us/team/ -> newdomain.com/about-us/team/ currentdomain.com/webinars/(any page) -> newdomain.com/webinars/(same page name) I found this page (https://gist.github.com/ScottPhillips/1721489), and I think below is close to what I need, but like I said, I'm not really sure how this all works. I think I need "redirect from old domain, with subdirectory and/or full path, to new domain with sub directory and/or full path" #Redirect from old domain to new domain with full path and query string: Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*) http://www.newdomain.com%{REQUEST_URI} [R=302,NC] #Redirect from old domain with subdirectory to new domain w/o subdirectory including full path and query string: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_URI} ^/subdirname/(.*)$ RewriteRule ^(.*) http://www.katcode.com/%1 [R=302,NC] This site is built in Wordpress. Thanks for any help!
April 14, 201511 yr Maybe you can try: # Redirect old file path to new file path Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html one by one, I think that could work. You can also try this one: http://www.woothemes.com/2013/11/htaccess-url-redirects/
April 16, 201511 yr If you hosting has cpanel I've seen a section in admin that allows you to manage redirects without editing the htaccess directly.
Create an account or sign in to comment