What is the best way to do a redirect?

Hi,  I have a D6 site in directory /members, but have installed an migrated to D7 in a different directory /community.  What is the best way to "redirect" so that anyone - members, search engines, etc visit any of the pages in /members they are automatically redirected to /community.  I would rather not delete the D6 site just yet.  I've read a bit about 301 redirect and mod rewrite, but it seems oriented to pages - not an entire directory.   What is the best way to do this?

Thanks

Rob

Quote · 21 Dec 2009

I've done this before via my DNS and where it points my IP's locaiton, especially when making subdomains.  There isn't anything set in stone that requires your site.com url to go to /home/www/ instead of /home/www/dolphin7/

Edit: doing this will mean you can't get to your d6 site via browser anymore.

edit: and if you are on a dedicated box you can just edit your apache config file for your user account to make the public_html directory wherever your dolphin install is located.

Quote · 21 Dec 2009

No.. you can't change dns pointers.

In .htaccess : (This goes in root directory of old site)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^yoursite.com [nc]
rewriterule ^(.*)$ http://www.yoursite.com/$1 [r=301,nc


NM... this won't work if everything is on the same domain.  That dolphin .htaccess in the root will screw this up

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 21 Dec 2009

Try adding these 2 lines just below the opening php tag in inc/header.inc.php in the site you want redirected.

Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://yoursiste.com" );

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 21 Dec 2009

Thank you.  Not a technique I am familiar with, but it seems to work.  Here is the old link: http://caltrade.com/members

Quote · 21 Dec 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.