tags:

views:

35

answers:

2

Well this is really simple but I have no clue..

I have a htaccess file in home directory which points all php files to index.php on home directory.

RewriteRule ^.*php index.php [L]

Now i have created a subdirectories like example.com/mydir/

I want a generic htaccess inside subdirectories that should point

example.com/mydir/ to example.com/index.php

and dont consider any other files.

possible ?

+1  A: 

You can do all this from the .htaccess in your home directory. See mod_rewrite, a beginner’s guide (with examples) and mod_rewriting an entire site.

Skilldrick
thanks, well i wanted to keep things simple, btw which one has more priority, htaccess in home dir or in sub dir ?
atif089
I don't think you'd have any need for .htaccess in subdirs...
Skilldrick
no definately not, also have a look at these:http://www.webweaver.nu/html-tips/web-redirection.shtml and http://httpd.apache.org/docs/1.3/howto/htaccess.html
Matti
A: 

Try it with an absolute URL path in your substitution:

RewriteRule ^.+\.php$ /index.php [L]
Gumbo