I developed a new site to display my demos. I could simply htaccess 301 my entire site. But then every visitor would be confused they didn’t land on their expected page. But that’s best for google. I could meta refresh after 5 seconds and say the site has moved, so good for visitors, but meta is bad for seo. I could php 301 it using the same ideas.
Is there any other way I’m not thinking of? If you switched domain names, and you spent the last 6 years building seo for your old domain, how would you 301 redirect to your new domain? Remembering that I also want to inform visitors that I changed locations.
Whether your domain page has same category or not…In case,it would be same category users can easily identify their expected page, once you redirect the domain page to new page…
Well first, oops, I may have mis-copied it (found it on Apache’s website). It is supposed to check what domain is being accessed, and redirect to another.
You could 301 redirect visitors to the new domain, and on the new domain check the referrer for the old domain name and if the old domain name is found in the referrer, display a notice letting the visitor know what’s going on.
This way for any page that existed on the old site as long as the same page names or index plus parameters will be redirected to the same page name on the new site. The seo bots will learn the 301 and your juice won’t be lost.
If both domains point to the same location, you would likely introduce an infinite loop, as it is redirecting all requests to newdomain.com and if newdomain.com resolves to the same location as olddomain.com it will still enforce that redirection as it doesn’t specify the request had to be made from a specific host.
I dont know. JdMorgan with 25,000 posts says to use that above one liner. http://www.webmasterworld.com/apache/3242480.htm. Sorry - not being argumentative - just trying to find the best way to do this.
OH WAIT! My bad. I miss spoke. I just realized. This is probably going to make it easy. They are not going to match from old to new - not 1:1. They are going to be olddomain.file.php and newdomain/folder/file.php. And the folder changes depending on the file group. So in that case what would be the best way? I have 800+ pages. So it’s probably impracticable to redirect each seperatly. So should I just redirect the entire old domain to the new domain root?
Can you give us more examples of the redirections you need? If there is a pattern, it wouldn’t be terribly difficult to get the redirection to handle all 800 pages.
For example:
olddomain/file.php newdomain/folder/file.php (need to know how folder would be defined, hard coded?)
olddomain/folder-file.php newdomain/folder/file.php (grab folder from filename)
etc.
Without know what you have and where you want it to go, then the only recommendation I have is to redirect all traffic to the root of the new domain (although it would be best to redirect to the new page location).
I think it’s going to be easiest to just redirect to the root but you tell me. I don’t beleive there is going to be a pattern. I have 800+ css, php, htaccess, js, photoshop, etc demos and such. In the old domain they were all just in olddomain/code/demo.php. Now in the new domain I am going to group them into there corresponding folder. So css demos will go in newdomain/code/css/demo.php. PHP demos in newdomain/code/php/demo.php and so on. There will be about 17 newly named folders/groups that the files will be going into. Thanks!
Ah, you are probably right, it might not be easy to redirect all of those. I’d personally go the blanket redirection route at this point in time, if you weren’t worried about losing your search results. If you want the search result to remain valid, you’ll have to write conditions for each page unfortunately (or so it seems)…
Hmmm. What am I then? It’s on the same server. But a different folder I believe. Meaning I will delete the olddomain addson and add the new domain addon. So the host/server “should” view it as a new folder right?
The host set up is… The main domain sits in public_html/ and the addon domain (the new and old domains) site at public_html/addondomain. Let me know if that’s not clear. Thanks a lot for the continued help!
Additionally they are not sub domains. But full fledge domains.