I have trouble with getting my .htaccess to operate like I would like and I'm wondering if anybody could shed an easy about this.

Here's my current setup:

My hosting that is shared site could be utilized by http://www20.a2hosting.com/~myname/

I've several sub sites within that If only to gain access to. For example http://www20.a2hosting.com/~myname/subdir/public/index.php works all right.

Now I am looking to get all of the calls to my subdir/public be re-forwarded to my index.php and also to that extent I have produced b .htaccess file during my subdir/public that appears as following:

RewriteEngine on

RewriteRule ^.*$ index.php

However, after i direct my browser to http://www20.a2hosting.com/~myname/subdir/public/ I recieve the next 404 Error:

The asked for URL /home/myname/public_html/subdir/public/index.php wasn't available on this server.

What am I doing wrong?

Thanks!

Try indicating a complete path because the rewrite target:

  RewriteRule ^.*$ /index.php