Featured Posts

Don't pretend you know me I read a post today from Seth Godin, Faux familiarity is worse than none at all, about how often marketers today overuse and abuse personalization when communicating electronically...

Readmore

How DIRECTV failed in its new customer incentive program Companies spend a significant amount of time and money creating incentives to attract new customers.  This is an age-old tactic that continues to be used because it works. ...

Readmore

What's in a domain name? With the recent announcement from ICANN of the release of potentially new domain extensions beyond the existing (com, net, org, edu, etc.) we have to wonder what is the value...

Readmore

The day my son changed the world We've all heard it before and those of us who are blessed with children, nieces and nephews have perhaps even told them once or twice; you can do anything and accomplish anything...

Readmore

Identifying the ideal metrics for measuring customer... Over the past twenty years I’ve been fortunate to have worked with a number of great companies and helped develop and manage their various CRM and loyalty programs. Many...

Readmore

Jeremy Schell Rss

Recursive .htaccess redirects

Posted on : 08/22/2011 | By : Jeremy Schell | In : Coding, Internet

0

Recently I came across a request on Twitter for an effective means to update the .htaccess file to redirect all pages to a new domain without having to update for all subdirectories.  Here are a couple choices which can be easily placed in the root .htaccess file.

OPTION 1 (this does not need the RewriteEngine module)

Option 2 (this requires the use of the RewriteEngine module)

  • Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^oldwebsiteaddress.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.oldwebsiteaddress.com$
    RewriteRule (.*)$ http://www.YourNewDomainAddressHere.com/$1 [R=301,L]
Pass it forward:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • email
  • HackerNews
  • LinkedIn
  • RSS
  • Slashdot
  • Tumblr
  • Twitter
  • Yahoo! Bookmarks
  • StumbleUpon

Comments are closed.