Parked Domain Names, Subdirectories, and Root Redirection

A problem developed recently. Some time ago, I pointed my main domain and a parked domain to the same spot, my public_html directory. Recently, I decided to move my domain to a subdirectory where new blogging software was installed.

I elected to use Apache’s mod_rewrite. When you read in a multitude of sites that mod_rewrite can be tricky, believe it!

So, to redirect my main domain, softwarefemme.com, to a subdirectory index.php, but yet keep the parked domain, www.thewildlifeporch.com, directed to the main index.php:

(make sure to replace my domains with yours!)

# FOR GENERAL REWRITING

Options +FollowSymlinks
Options -Indexes
RewriteEngine on

# REDIRECT SWF

RewriteCond %{HTTP_HOST} ^softwarefemme\.com$ [NC]
RewriteRule ^$ wpswf/index.php [L]

# REQUIRED FOR TWP CLEAN URLS

RewriteCond %{HTTP_HOST} thewildlifeporch\.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^  ./index.php
You can leave a response, or trackback from your own site.

Leave a Reply

AWSOM Powered