apache - htaccess rewrite scenario -


i have scenario have 2 files, 1 index.php , other index.htm.

how setup rewrite condition / rule if index.htm exists on server in subdirectory, pass request file. , if file not exist pass request /index.php?

it depends on subdirectory structure, 1 solution use index.php exclusively, , write php @ front of index.php check existence of other file:

 if(file_exists("subfolder/index.htm")) exit(file_get_contents("subfolder/index.htm")); 

otherwise, check out flags rewritecond

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -