Twilight SEO

Standing at the border line. Beautiful color spectrum of Search Engine Optimization. White, Gray, Black Hat SEO learning by doing.

Subdomain 301 Redirection using .htaccess

Posted in Uncategorized by ruru on the December 18th, 2008

I'm planning to post a lot more script, snipplets, whatever you called it. Mainly covering minisites, scraped pages, cycled pages, etc. Used properly, each of my post will help you making money. No guarantee. Period :P

So i pick a better name for my blog, and figure out that i need to redirect it to the new one. Here's the code i save it as .htaccess and put it on public_html/php folder:

PHP:
  1. RewriteEngine on
  2. RewriteCond %{HTTP_HOST} ^php.fallenray.com$ [OR]
  3. RewriteCond %{HTTP_HOST} ^www.php.fallenray.com$ [NC]
  4. RewriteRule ^(.*)$ http://rainbowhatseo.fallenray.com/$1 [R=301,L]

My hosting use cPanel. It has the function to do this, but i simply doesn't satisfied with the result.
Above code will permanently (301) redirect from php.fallenray.com to rainbowhatseo.fallenray.com

Leave a Reply




Cannot find your answer here?
Feel free to get in touch and ask PHP-ist anything, just anything :)