Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect all files in a directory to another in root via htaccess

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 ?

like image 404
A.B.Developer Avatar asked Sep 10 '11 16:09

A.B.Developer


1 Answers

Try this:

RewriteEngine On
RewriteRule ^user/(.*)$ http://domain.com/temp.php [R,L]
like image 69
Book Of Zeus Avatar answered Sep 21 '22 12:09

Book Of Zeus