Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Forwarding to new Website
Old 11-24-2006, 06:49 AM Forwarding to new Website
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 201
Trades: 0
Hi,

I need some kind of cleaver redirect code here!

Domain A have about forty specific URLs that I would like to forward to the new Doman B. How should I do this in a search engine re-index new URL only friendly way?

Domain A should be used for other purposes, so it must not be excluded from search engines all together. And it should not be delayed from the forwarding/URL rewriting to Domain B either.

Any hot tips and example code here?

Apache server, PHP
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-24-2006, 07:00 AM Re: Forwarding to new Website
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Why clever code ?

just add
Code:
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/newdir/newpage.htm");
exit();
to the top of each page to redirect
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-24-2006, 07:27 AM Re: Forwarding to new Website
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 201
Trades: 0
Uhm, do you got another suggestion that don't leave so many "empty" documents on the server?
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
Old 11-24-2006, 07:56 AM Re: Forwarding to new Website
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
not sure why "empty" documents would be a problem but,

write 40 lines in your .htaccess file to catch those specific pages being requested
write 40 lines in a custom 404 page to catch those specific pages erroring out

If the page URLs have some common feature (other than the hostname) use wildcards on either of the above solutions.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-24-2006, 11:25 AM Re: Forwarding to new Website
Moldarin's Avatar
Extreme Talker

Latest Blog Post:
Keyword Density and Title Tags
Posts: 201
Trades: 0
Quote:
Originally Posted by chrishirst View Post
(..) write 40 lines in a custom 404 page to catch those specific pages erroring out (..)
OK, I did not quite cough that one. How could I do this? :/
__________________
I do not share ad revenue.
Moldarin is offline
Reply With Quote
View Public Profile
 
Old 11-24-2006, 08:14 PM Re: Forwarding to new Website
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Have the old URIs and new URIs in arrays.
Grab the requested URI from the page. (it's usually sent in $_SERVER("QUERY_STRING") with "404;" prepended to the original URL).
Find this in the array and then redirect to the new URL indicated by the array index.


The code in the earlier post will do the SE "friendly" redirect.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-15-2007, 07:38 AM Re: Forwarding to new Website
Novice Talker

Posts: 7
Name: MK
Location: Hong Kong
Trades: 0
You can just do a mod_rewrite in Apache? It's cleaner and the rules are flexible.
__________________

Please login or register to view this content. Registration is FREE
online flower shop
maliciouskitty is offline
Reply With Quote
View Public Profile Visit maliciouskitty's homepage!
 
Old 01-26-2007, 05:49 PM Re: Forwarding to new Website
RanaD's Avatar
Super Talker

Posts: 139
Name: David
Trades: 0
The .htaccess option is probably best. Six months (hopefully 3) maximum is the timeframe we're looking at for a search engine finding the new pages. Any search engine not finding them in that time-frame is not important.

Depending on the structure of the site, mod_rewrite could be a better option. Else, forty lines of custom .htaccess code, to me, is far the preference above writing 40 redirect files.

Whichever route you choose, a permanent redirect is needed. Not only for search engines, but also for users who may have bookmarked.
RanaD is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Forwarding to new Website
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.63518 seconds with 12 queries