Invisible .htaccess Redirect from /public_html/ to /public_html/folder

Posted by dosboy on Stack Overflow See other posts from Stack Overflow or by dosboy
Published on 2010-05-28T08:12:18Z Indexed on 2010/05/28 8:21 UTC
Read the original article Hit count: 294

Filed under:
|

I need to point the root domain of my hosting account to a subdirectory (joomla). I want this to be invisible (i.e. browser address bar doesn't change). Also, I need this to work when a user hits the root or a subfile/subfolder.

I've tried the following rules, which work individually, but I can't get them to work together.

This one works when no subfile/subfolder is specified:

RewriteEngine On
RewriteRule ^$ /joomla/ [L]

And this one works when a subfile/subfolder IS specified:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+)$ /joomla/$1 [L]

I just can't figure out how to combine them.

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about redirect