3d.coldstreams.com is the new URL for coldstreams.com/video

Bella & her Vintage Camera
Bella & her Vintage Camera (Photo credit: Kamila Gornia)

The old URL coldstreams.com/video should automatically and transparently redirect to

3d.coldstreams.com

The “video” name is no longer the best descriptor for this blog as the focus is now 3d still and 3d video photography.

This change was implemented in a way that should be transparent – if you still have your bookmark set to coldstreams.com/video or your RSS newsreader set to the old address, everything should continue to work through the automatic redirection.

——————–

How to do this

Information on moving your WordPress folder contents to a new folder (what has to be done)

Then, I set up a .htaccess file in the root directory of my virtual server (for me, this is a folder named httpdocs running on Apache) to redirect from the original folder to a subdomain. I put the following in the .htaccess file

RewriteEngine on
RewriteCond %{HTTP_HOST} ^coldstreams[.]com$ [OR]
RewriteCond %{HTTP_HOST} ^www[.]coldstreams[.]com$
RewriteRule ^video/?(.*)$ http://3d.coldstreams.com/$1 [R=301]
RewriteCond %{HTTP_HOST} ^coldstreams[.]com$ [OR]
RewriteCond %{HTTP_HOST} ^www[.]coldstreams[.]com$
RewriteRule ^(.*)\.^(.*)$ http://coldstreams.com/$1

This uses the mod_write engine inside the Apache server. The first two conditions look for this website’s URL. The first RewriteRule then matches the original /video followed by anything and redirects it to the new URL followed by the anything that was part of the original URL.

If the URL did not include the /video folder name, then it continues to look for matching rules. The next set of rules matches anything else (e.g. coldstreams.com/xyz) and maps it to itself  (coldstreams.com/xyz maps to coldstreams.com/xyz).

The trailing [R=301] passes back some information to the caller (such as a search engine) that the page has been moved to a new location.

I posted this techie subject on the 3D blog because many of the web site examples I ran across that described how to redirect did not actually work except in a special case.

Enhanced by Zemanta

Leave a Reply

Your email address will not be published. Required fields are marked *