Take the 2-minute tour ×

I want to redirect all files (whether it exists or not) in /user directory on my site to a file named temp.php in root directory via .htaccess.

For example, if a user enter user/send.php or user/ or user/send (It may be that not Exists at all), all redirect to temp.php.

How can i do this ?

share|improve this question
Does this redirect includes images? CSS? JavaScript? as well? –  Book Of Zeus Sep 10 '11 at 16:15
no all files in this directory are php –  ahmad Sep 10 '11 at 16:26

1 Answer 1

up vote 5 down vote accepted

Try this:

RewriteEngine On
RewriteRule ^user/(.*)$ http://domain.com/temp.php [R,L]
share|improve this answer
yes! it works fine. –  ahmad Sep 10 '11 at 16:43

Your Answer


