Forum Moderators: open
My reasons for doing this are on this thread: [webmasterworld.com...]
Apache mod_alias [httpd.apache.org]
On the instruction I saw the following:
-------------------
Syntax: Redirect [status] URL-path URL
Example:
Redirect /service [foo2.bar.com...]
If the client requests [myserver...] it will be told to access [foo2.bar.com...] instead.
permanent
Returns a permanent redirect status (301) indicating that the resource has moved permanently.
-------------------
Would someone tell me if I understand this right?
Lets say that the wrong site is called www.bigspanners.com and the new correct site is called www.mysite.com
So should I create a .htaccess file with the following contents:
Redirect [permanent]/www.bigspanners.com//www.mysite.com/
And put that in the root folder of www.bigspanners.com - or should it go in every folder???
1. You only need to put this in the .htaccess of the root folder - (The .htaccess is cascaded in all higher level directories)
2. I don't think you put the domain name in URL-path; just leave it /
3. If the whole site is mirrored, then that's all you should need. But if you've renamed pages, or moved to different named folders, you'll need multiple redirect lines.
I would just try it. If it doesn't work, you can remove it.
redirect [permanent] [wrongdomain.com...] [mydomain.com...]
and
redirect [permanent] [mydomain.com...]
What am I doing wrong ??? :(
ps: (.htaccess works on other sites on the same server for password access etc).
redirect permanent / [mydomain.com...]
No brackets.
If that doesn't work, try removing the trailing slash after .com[/]
Let's suppose that you have a web site [domain.com...] and you want [domain.com...] to do a client-side 301 error redirect to the [domain.com...] site.
To perform the redirect, suppose that the content for www.domain.com comes from c:\inetpub\ www-domain-com:
tried:
redirect permanent [mydomain.com...] [mydomain.com...]
Didn't work, other variations didn't either. Any tips?
Well I put the following into a file called .htaccess and it worked:
redirect permanent / [mydomain.com...]
Does that mean that I can remove the content from the old domain? I would rather just have an index page that says this site has moved to www.otherdomain.com. I'm thinking that this would help my 'otherdomain' get its PR back.
Didn't work, other variations didn't either. Any tips?
Yes found the answer:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.MY_DOMAIN\.com [NC]
RewriteRule ^(.*) [MY_DOMAIN.com...] [L]
Marty
[httpd.apache.org...]
kapow, all the following produce a 301 error
RedirectPermanent
Redirect permanent
Redirect 301
> Does that mean that I can remove the content from the old domain?
Yes, provided that you keep the same directory structure and filenames for the new domain.
> I feel more confident that Google will reolise this is a permanent change now.
IMHO and based on experience Google will recognize the permanent redirect. All the old domain and pages, should be replaced with the new domain and pages.
I know that it works for 301 redirects within a domain. I renamed several of my pages and Google removed all the old pages and replaced them with the new pages.