2013-03-03, 04:32:28
my solution:
index.php
index.php
PHP Code:
# get data from page
$my101 = $_SERVER['REQUEST_URI'];
$data_index = getXML($file);
...
#http://site.com/subdir1/page_from_subdir1.html = ok
#http://site.com/page_from_subdir1.html = redirect
if (($parent != '') && (substr_count($my101,'/')==1)) {
redirect('/index.php');
}
#http://site.com/page1.html = ok
#http://site.com/page1.html/ = redirect
if ((strpos($my101, '.html/')!=0) || (strpos($my101, '.php/')!=0)) {
redirect('/index.php');
}