Page 1 of 1

Redirect All traffic

Posted: Tue Jul 08, 2008 1:49 pm
by hawleyjr
What is the best way to redirect all traffic php/css/js/images, etc. to an account suspended page?

I was just going to put a header redirect in the header of the PHP pages but I'd like to do it for images also.

Any ideas?

Oh, and once they pay me I will need to put it back so I don't want to remove any files ;)

Re: Redirect All traffic

Posted: Tue Jul 08, 2008 1:54 pm
by Eran
Use the redirect capabilities of the server. If you're on Apache, read on mod_rewrite - http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Re: Redirect All traffic

Posted: Tue Jul 08, 2008 1:58 pm
by hawleyjr
Yeah they are and I'm using it for a 404 error page. I just wasn't sure how to do it for all traffic... Time to read :)

Re: Redirect All traffic

Posted: Tue Jul 08, 2008 2:03 pm
by Luke
You don't need mod_rewrite for this...

http://httpd.apache.org/docs/1.3/misc/howto.html

Re: Redirect All traffic

Posted: Tue Jul 08, 2008 2:08 pm
by hawleyjr
I looked into that but it also sends an HTTP 302 Redirect back to the client. Which I really don't want. This is really just a "Hey, time to pay message"