Multiple URL's 301 Redirect Required
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Multiple URL's 301 Redirect Required
Multiple URL's 301 Redirect Required
17-05-2013 10:14 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have searched through many articles and forums now to find the answer and a method to achieve what I'm trying to do. We have several URL's for our main website - www.draycast.co.uk - which are www.sandcastings.co.uk, www.aluminium-bronze-castings.com & draycast.co.uk (non www). I understand these are acting as 4 separate sites which is having an effect on our Google rankings because of the duplication. I have been told that we need to set up 301 redirects to www.draycast.co.uk from the other URL's to prevent this. I have seen from several articles that I need to put the redirect in the .htaccess file to stop duplication. When I have connected to our site server with CuteFTP I find that there isn't a file called this and just an .htdocs file with all the webpages from the main site on it. My question is why do I not have an .htaccess file showing and can I create one. Also if I do have an .htaccess file (I understand it may be hidden but even so I still can't find it) do I put 3 entries in it for the 3 sites I'm trying to redirect. This bit I don't really understand as I can't see how the 3 sites are working as I have only one webspace. There must be something somewhere telling a browser to access the website I've uploaded to www.draycast.co.uk when someone views www.sandcastings.co.uk for example. Sorry if this seems laboured but most of the information I've read seems to require a level of knowledge in HTML that is above me so any help in basic language would be really appreciated. I'm using Webplus 6 to produce my site if this has any bearing on things.
Re: Multiple URL's 301 Redirect Required
17-05-2013 10:45 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: draycast why do I not have an .htaccess file showing and can I create one.
A .htaccess file will only exist within your site if you've created it, it's a directory level configuration file, so where it appears has an effect on the servers behaviour.
In this instance, you want to create one with the appropriate settings and put it in the root of your site (so it end up inside htdocs).
Quote from: draycast This bit I don't really understand as I can't see how the 3 sites are working as I have only one webspace. There must be something somewhere telling a browser to access the website I've uploaded to www.draycast.co.uk when someone views www.sandcastings.co.uk for example.
As far as the browser is concerned, it has no idea that the sites are related as it is only interested in the URL for the pages and images.
The server handles the incoming requests, parses the URL used and fetches the files from the appropriate location, then returns the files with the appropriate URL based on the request.
The fact that the server looks into the same folder for the different sites is irrelivant to it too.
Unfortunately, I suspect this will pose a problem, as each site will have the same .htaccess file and will cause a redirect, including the main site redirecting to itself!
Hopefully someone with more knowledge of writing .htaccess files may be able to help with that.
BTW, you sandcastings site appears to be hosted seperately (going from the IP address it resolves too), so you could move the two sites that need redirecting to one address with the main site on the other.
Re: Multiple URL's 301 Redirect Required
19-05-2013 12:31 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
On homepages redirecting has to be done using mod_alias simple redirects which are intended for redirecting to a different site. Trying to use them to redirect to the same site (using its preferred name) would, as kmilburn mentioned, also redirect the preferred address causing an infinite loop.
One way to avoid this problem is to use the Member Centre Control Panel to change domain mapping for the two alternate domains to a subdireciory of /htdocs, then use a .htaccess file in that subdirectory to redirect to the preferred domain in the webroot (/htdocs) directory.
Let's assume you call the subdirectory /alternates (any name will do, as long as it differs from anything in use on the site).
The .htaccess file that goes in that subdirectory needs to contain
[code=.htaccess]
Redirect permanent /alternates http://www.draycast.co.uk[/code]
Note that .htaccess needs to be created as a plain text file using (for example) Notepad on Windows, then uploaded as ASCII to change line endings to Linux style. On Windows it is often easier to create and upload it as htaccess.txt, then rename it to .htaccess using your FTP program. The FTP program needs to be configured to show hidden files to make .htaccess visible.
To test this is working visit www.sandcastings.co.uk/alternates - you should find this is redirected to www.draycast.co.uk with that site's home page displayed and its address in the browser. Similarly for the other domain and for their non-www versions. Assuming this works if you now use the Control Panel to change domain mapping to direct those alternate sites to the /htdocs/alternates subdirectory the change should come into use without affecting visitors.
This still leaves www.draycast.co.uk and its non-www equivalent pointing to the same (duplicate) content. For Google I think one can use Webmaster tools to specify the www form is the preferred canonical name.
Edit:
I think for all search engines it is permissible to add a link tag with rel=canonical in the head section of the site's index.html file pointing back to itself as a hint that the www form of the page is the preferred link. Thus:
[code=for link tag in head section of page]
<link rel="canonical" href="http://www.draycast.co.uk">[/code]
Re: Multiple URL's 301 Redirect Required
20-05-2013 10:08 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Multiple URL's 301 Redirect Required
20-05-2013 1:25 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Without /alternates the behaviour is (currently) the same as it was before because the redirection affects only the /alternates folder and we aren't going there. The second part of the change via the Domain names Control Panel should fix this.
So yes, you need to login to the Member Centre on your Plusnet account, select Domain names then Configure for your sandcastings.co.uk domain. In the Domain Hosting Settings section you leave the Default radio button selected and type alternates in the text box alongside /htdocs/. Then click the Submit button.
This will cause the domain maps on the server to be changed so that visitors to www.sandcastings.co.uk (with or without www) are sent to the /alternates folder from where they are redirected to the main site under its preferred name.
A similar change needs to be made for the aluminium-bronze-castings.com domain (but draycast.co.uk is NOT changed).
Once these changes take effect (overnight?) visitors to www.sandcastings.co.uk, again with or without www, should be redirected to the preferred site. In the meantime behaviour will be unaffected - no one should get a 404 page-not-found error.
The final step is to put that <link rel="canonical" ...> tag in the head section of the site's index.html file as a hint to search-engine crawlers that the www link to the page is the preferred reference. Note this should go only in that index.html file, other files seem to be addressed by absolute addresses which are the preferred form.
Re: Multiple URL's 301 Redirect Required
20-05-2013 2:35 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Multiple URL's 301 Redirect Required
20-05-2013 7:55 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
My suggestion is to backspece in that textbox to make sure it is empty then type alternates again, submit - and be patient.
Re: Multiple URL's 301 Redirect Required
21-05-2013 9:28 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Multiple URL's 301 Redirect Required
21-05-2013 9:52 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Redirect permanent / http://www.draycast.co.uk
Gabe
Re: Multiple URL's 301 Redirect Required
21-05-2013 11:19 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
[code=.htaccess]
Redirect permanent / http://www.draycast.co.uk/[/code]
… so that a request for a particular file via an alternate domain, eg www.sandcastings.co.uk/uk_aluminium_bronze_casting_production_foundry.html doesn't redirect to www.draycast.co.ukuk_aluminium_bronze_casting_production_foundry.html (which doesn't exist).
Re: Multiple URL's 301 Redirect Required
21-05-2013 12:57 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Multiple URL's 301 Redirect Required
21-05-2013 1:55 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.draycast\.co\.uk [NC]
RewriteRule ^(.*) http://www.draycast.co.uk/$1 [L,R=301]
You shouldn't need the redirects via /alternates. All domains can point at htdocs, subject to this rewrite. Though, having got it working that way, you could just leave it.
Gabe
Re: Multiple URL's 301 Redirect Required
21-05-2013 8:46 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Multiple URL's 301 Redirect Required
22-05-2013 9:23 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Sorry, I should have been clearer: it's a simpler and more comprehensive alternative to the redirects, not an addition to the redirects. Apologies for the confusion.
Gabe
Re: Multiple URL's 301 Redirect Required
22-05-2013 2:52 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Multiple URL's 301 Redirect Required