PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Jul 08, 2020 8:43 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Jan 17, 2012 9:18 pm 
Offline
Forum Commoner
User avatar

Joined: Sun Jun 20, 2010 6:45 am
Posts: 49
I want to every request for any file or directory on my server to be redirected to a specified file on the server.

The file I want everything to redirect to is: "/var/www/test.php".

I think this might be possible with htaccess files but I'm unsure, can anyone help?


Top
 Profile  
 
PostPosted: Wed Jan 18, 2012 7:46 am 
Offline
Forum Newbie
User avatar

Joined: Wed Jan 18, 2012 7:35 am
Posts: 24
Location: London
You should be able to do it with mod_rewrite.

i'm not 100% sure this will work but you can give it a go in your .htaccess

RewriteEngine On
RewriteBase /
RewriteOptions MaxRedirects=1
RewriteRule ^.*$ test.php [NC,L]


Top
 Profile  
 
PostPosted: Wed Jan 18, 2012 3:10 pm 
Offline
Forum Regular
User avatar

Joined: Tue Sep 28, 2010 11:41 am
Posts: 984
Location: Columbus, Ohio


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group