htaccess newb: if file !exists, redirect...
Posted: Sat Jan 22, 2005 11:53 am
Hello there,
I would like an htaccess script that, when someone goes to mysite.com/foobar.html, checks to see if the file foobar.html exists, and if it DOESN'T, tell it to display pagefromdb.php?page=foobar.html (while leaving the url in the browser as mysite.com/foobar.html).
Here is what I need in pseudo code:
Could one of you point me in the right direction for what I need to do?
I hope I was clear enough...
- Monkey
I would like an htaccess script that, when someone goes to mysite.com/foobar.html, checks to see if the file foobar.html exists, and if it DOESN'T, tell it to display pagefromdb.php?page=foobar.html (while leaving the url in the browser as mysite.com/foobar.html).
Here is what I need in pseudo code:
Code: Select all
if file exists {this_page} == false
display pagefromdb.php?page={this_page}
else
display {this_page} //fileI hope I was clear enough...
- Monkey