Redirection Problem
-
Wondering if anyone could offer some tips here please. I cannot share the site name so will try and be as detailed as possible.
My client had their site on a .com domain and have decided to move to a co.uk domain. The new site has been put on the uk domain with more or less the same structure, save for pages which have been removed or merged.
I am now setting up 301 redirects to tell the engines about the moved site, however this is giving me no end of grief. I can get domain.com to redirect to domain.co.uk no problems, however, if I try and redirect any of the inner pages to their new locations they all end up on the .co.uk home not where they should be. Given the homepage isn't designed to rank for all the terms.
The htaccess I am using is below, I cannot see anything wrong with it, can anyone else?
Redirect 301 / http://newdomain.co.uk/
Redirect 301 /villa_rental.php http://newdomain.co.uk/villa_rental.html
Redirect 301 /new_home.php http://newdomain.co.uk/new_home.html
Redirect 301 /http://newdomain.com/villas.php http://newdomain.co.uk/villastyles.html
Redirect 301 /developments.php http://newdomain.co.uk/developments.html
Redirect 301 /solana_hills.php http://newdomain.co.uk/solana_hills.html
Redirect 301 /middle_east.php http://newdomain.co.uk/middle_east.html
Redirect 301 /denia.php http://newdomain.co.uk/denia.html
Redirect 301 /faq.php http://newdomain.co.uk/faq.htmlI have tried both relative and full paths for the old site but doesn't make any difference. Does it matter the old site is php and the new html?
many thanks
-
Hi Carl,
You should be able to do this with one rule:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) [newdomain.co.uk] [R=301,L]Give this a shot and see if it works. It should direct http://www.olddomain.com/villa_rental.php to www.newdomain.com/villa_rental.php and so forth.
Cheers,
Jane
-
May be totally wrong here, but it is a quick test...
Switch the order of your redirects. First list all the old specific page to new specific page rules. Then last in the list put this rule - Redirect 301 / http://newdomain.co.uk/ (which you currently have first). That may let most of the specific pages do their thing before that general rule sends whatever is left to the homepage.
The way you code your htaccess is a bit different from what I do. Mine has a lot more code for each rule, and some qualifiers like L and NE...
Let us know if it works?
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Problems preventing Wordpress attachment pages from being indexed and from being seen as duplicate content.
Hi According to a Moz Crawl, it looks like the Wordpress attachment pages from all image uploads are being indexed and seen as duplicate content..or..is it the Yoast sitemap causing it? I see 2 options in SEO Yoast: Redirect attachment URLs to parent post URL. Media...Meta Robots: noindex, follow I set it to (1) initially which didn't resolve the problem. Then I set it to option (2) so that all images won't be indexed but search engines would still associate those images with their relevant posts and pages. However, I understand what both of these options (1) and (2) mean, but because I chose option 2, will that mean all of the images on the website won't stand a chance of being indexed in search engines and Google Images etc? As far as duplicate content goes, search engines can get confused and there are 2 ways for search engines
Web Design | | SEOguy1
to reach the correct page content destination. But when eg Google makes the wrong choice a portion of traffic drops off (is lost hence errors) which then leaves the searcher frustrated, and this affects the seo and ranking of the site which worsens with time. My goal here is - I would like all of the web images to be indexed by Google, and for all of the image attachment pages to not be indexed at all (Moz shows the image attachment pages as duplicates and the referring site causing this is the sitemap url which Yoast creates) ; that sitemap url has been submitted to the search engines already and I will resubmit once I can resolve the attachment pages issues.. Please can you advise. Thanks.0 -
302 redirects, canonicalise or redirect (301)?
Hey Guys, I am fairly new to 'technical' SEO as I was lucky enough in my old role to have technical expertise in the team for things like this, now I am learning myself and it is a slow and painful process, so your expertise is soooo much appreciated! My I.T. dept say that I have 3 instances on my website where the Hybris platform is creating a 302 redirect automatically - the first: URL doesn't exist - Hybris creates a temp 302 - the system does not create case sensitive url's | http://www.example.fr/Example/Marques/0180/brand/CHANEL | URL doesn't exist | TRUE | 302 | | http://www.example.fr/Example/Marques/0015/brand/Giorgio-Armani | URL doesn't exist | TRUE | 302 |
Web Design | | eLab_London
| http://www.example.fr/fr/Example/marken/0507/brand/lancome | URL doesn't exist | TRUE | 302 | I believe these are being redirected due to the fact that capital letters are being created in the url. Multi-lingual redirects I have a German and French version of my site and whenever any switches from one URL to the other using our language selector a 302 is created. Dynamic URL elements Dynamic url elements and special characters are being created in the URL, I am not sure where this is happening, but my I.T. department would like me to go and see whether this is something that can be created by a browser. If anyone has any similar problems or have any advice or insights even, I would love to hear from you! Thanks 🙂0 -
301 forwarding during site migration problem - several url versions of the same page....
Hello, I'm migrating from an old site to a new site, and 301 forwarding many of the pages... My key problem is this I'm seeing www.website.com/ indexed in SE and www.website.com/default.aspx in showing as URL when I'm on homepage - should I simply 301 forward both of these? Then for several internal pages there are 2/3 versions of each page indexed. Canonicalization issues. Again, I'm wondering whether I should 301 forward each URL even if there are several different indexed URLs for the same page? Your advice will be welcome! Thanks in advance - Luke
Web Design | | McTaggart0 -
How do I move a 200+ website properly with 301 redirect?
I tried to search for the answer but didnt find any direct answers. I need to move a 200+ site to a wordpress site. How am I suppose to 301 redirect all of them? Do I need to create the new pages first then have webmaster use ssh and 301 the entire list? Can anyone link me to a 1,2,3 step instructions for a huge website move? Im sure there are other issues that I need to know about.
Web Design | | bryonstout0 -
Redirecting Images
Hi, I'm wondering how important it is when relaunching a site on a new platform (switching to Drupal) to serve up images from the same file paths in order to ensure consistency during the changeover. I've tried to keep the questions straightforward so that this post can be useful to people in a similar situation in future: How much difference do the file paths make to SEO? Does Google care or even notice if the image file paths change? Is it worth forcing Drupal to mimic our old file paths for the sake of consistency with the old site in order to maintain rankings OR do we take the opportunity to redesign our file paths for better SEO? Any help would be much appreciated 🙂
Web Design | | Tinhat0 -
Do I need to redirect soft 404s that I got from Google Webmaster Tools?
Hi guys, I got almost 1000+ soft 404s from GWT. All of the soft 404s produce 200 HTTP status code but the URLs are something like the following: http://www.example.com/search/house-for-rent (query used: house for rent) http://www.example.com/search/-----------rent (query used:-------rent) There are no listings that match these queries and there is an advanced search that is visible in these pages. Here are my questions: 1. Do I need to redirect each page to its appropriate landing page? 2. Do I need to add user sitemap or a list of URLs where they can search for other properties? Any suggestions would help. 🙂
Web Design | | esiow20130 -
Is there a limit for 301 redirection in htaccess file?
For the SEO perspective, there is a limit for the number of 301 redirection inside the htaccess file?
Web Design | | Naghirniac0 -
Parked Domain or Redirect
Should I park a domain or Redirect? And what is the best way? I need to switch our domain name. I currently have all of our domains redirecting to our main website. I have set up there own hosting in our cpanel account so I could redirect them to our main domain. Was this too many steps? I tried putting all of our domains in our main domains, .htaccess file, and redirected them to our main website, but they did not work. So that is why I set up there own cpanel accounts. Now they work fine. However, my hosting company told me that I could just park the domain on our current domains account. If I can redirect all of these domain in one place, that would be great. I thought that a parked domain is considered duplicate websites, as both urls work, displaying the entire website with both urls. So Would I have to re upload our entire website to the account that I want as our main domain? Or is there another way of going about doing this?
Web Design | | hfranz0