Mod_Rewrite to hide subdirectories

Hey guys, I know you get tired of helping n00bs. I’ve read everything I can find, tried really hard and can’t figure this out.

I am trying to host multiple domains on one lunarpages server. The primary domain is on

The secondary domain is It is in the subfolder This mod_rewrite I came up with successfully routes it, and it shows “” but then as soon as I click any of the links including “Home” it becomes

I don’t get it. Technically, that folder shouldn’t exist, (ie and all it’s doing is rewriting to What am I doing wrong?


# Directive to always remove 'www' and/or redirect to correct domain.
RewriteCond %{HTTP_HOST} ^www\\.thediyworkshop\\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

# Directive to invisibly redirect to subfolder.
RewriteCond %{HTTP_HOST} ^$
RewriteCond %{REQUEST_URI} !^/diy/
RewriteRule ^(.*)$ /diy/$1


Ok, so not bumping this on purpose. I just can’t find any way I’m allowed to edit my post.

The mod_rewrite script is working fine. Sorry, it’s Joomla that’s writing it into my links. The fix was to rename joomlaroot/htaccess.txt to .htaccess (basically enabling it) open it up and change #RewriteBase /" to RewriteBase /joomaroot

Then go into the configuration.php in joomlaroot, and set var $live_site = “

Happily Redirecting! Thanks!
-GB Ward

Hi GB, and WELCOME to SitePoint’s Apache forum!

Thanks for updating and letting members know what problems you had with Joomla and how you resolved them.