View Single Post
Old 08-23-2012, 05:31 AM  
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
Quote:
Originally Posted by freecartoonporn View Post
seriously?

You didnt read my post.
or am i missing something here ?
I misunderstood becasue you're asking how to do something that is a very bad idea and should not be done, but here's how to redirect if a file does not exist...


Code:
# If requested resource exists as a file or directory, skip next rule
RewriteCond %{DOCUMENT_ROOT}/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/$1 -d
RewriteRule (.*) - [S=1]
#
# Else rewrite requests for non-existent resources to /index.php
RewriteRule (.*) /index.php [R=302,L]

I hacked someone else's code so double check it. I also made it 302 becasue 301 is a really really stupid idea in this situation.
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote