Redirect All traffic

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Redirect All traffic

Post 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 ;)
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Redirect All traffic

Post 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
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Re: Redirect All traffic

Post 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 :)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: Redirect All traffic

Post by Luke »

You don't need mod_rewrite for this...

http://httpd.apache.org/docs/1.3/misc/howto.html
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Re: Redirect All traffic

Post 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"
Post Reply