Its been about three years since I've played with apache and php(I've been using thin and nignx ;). So I've forgotten how to setup a mod_rewrite directive to forward all http requests from root to the application's installed folder.Current setup and restrictions:The site is on a shared cpanel hostingservice that doesn't allowapplications being installed as root(feature not a bug in my book forversioning and what not).CMS application was installed under joomla-1.5.60/I need to setup /(.*) to redirect to/joomla-1.5.60/$1 but still look tothe browser as /(.*)RedirectMatch does not workI cannot establish docroot as the application's root because of account restrictionsI've read over the docs by apache and I keep getting a redirection loop. So any help you guys can provide would be appreciated.Thanks,D.
How to setup mod_rewrite/htaccess to do url masking and forwarding to a subdirectory?
apache;redirects;url;mod rewrite;301 redirect
In case you didn't get this sorted out, looking at the rewrite rule you have in your pastebin linkRewriteRule ^(.*)$ http://www.diviniti.cc/joomla-1.5.20/$1 [R=301,QSA,L]there's a few things that are defeating your desires here:the R=301 directive will make the browser actually 'go away' and load up the rewritten url, changing the URL in the browseryour desire to also redirect any non-www subdomains to a www subdomain also conflicts with your desire to keep the joomla part of the URL hidden from the browser.Instead try two rules:Options +FollowSymlinksRewriteEngine On# 1. redirect (bounce) all non-www to www [as per apache docs][1] - retaining query stringsRewriteCond %{HTTP_HOST}   !^www\.example\.com [NC]RewriteCond %{HTTP_HOST}   !^$RewriteRule ^/(.*)         http://www.example.com/$1 [L,R,QSA]# 2. then, use joomla but hide the joomla dir - note the lack of 'R' directiveRewriteRule ^(.*)$ /joomla-1.5.20/$1 [QSA,L]If you don't care about enforcing the all subdomains should be www just skip rule #1, leave rule #2.You don't need the second rewrite you had in your pastebin, for the 'root':# Also redirect the root folder.RewriteCond %{HTTP_HOST} ^(*.)?diviniti\.cc$RewriteRule ^(/)?$ joomla-1.5.20/index.php [L]because the ^(.*)$ in my supplied rewrite also matches the case where the url is http://www.example.com/Now, it's possible that Joomla itself will not be happy with this chicanery, it may deeply not like being at this pseudo-root while the documentroot says something else and it's possible it will barf.1 : http://httpd.apache.org/docs/2.0/misc/rewriteguide.html#url per apache docs