This is what I currently have as my htaccess file...
setEnv HTTP_TARGET_PAGE %{REQUEST_FILENAME}
ErrorDocument 404 default
ErrorDocument 301 default
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
#the below line doesn't work
RewriteCond %{REQUEST_URI} *.php
#the above line doesn't work
RewriteRule ^.*$ ./index.php
I'm trying to have every php file or nonexistant file request pipe through index.php for processing. All the other php files are things sometimes included in index.php (using web address).
So I may have somewhere in my index.php
if($my_url = "www.example.com/potato"){
require_once("potato.php");
}
But I dont' want them typing in "http://www.example.com/potato.php" and getting the php directly without headers and such. My htaccess isn't working right (that one line borks it every time). But I don't want to rewrite everything because image files would then not work. How do I address it?