Quote:
Originally Posted by freecartoonporn
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.