Last time I wrote the search Engine friendly URL design-I'm tossing on this thing, to achieve this http://www.myhost.com/foo.php (as the current mainstream development language)? A=a&b=b&c=c- > http://www.myhost.com/foo.php (as the current mainstream development language)/a/a/b/b/c/c URL conversion, there are actually different ways.
For example, I use a virtual host, but also want to implement URL optimization, but I do not have server permissions, this time can be from Path_info.
Visit http://www.myhost.com/foo.php (as the current mainstream development language) when/a/a/b/b/c/c this URL, if Apache (Unix platform is the most popular Web server platform) Allowpathinfo has been opened, using PHP (as the current mainstream development language) to access $_server[path_info] can get a/a/b/b/c/c this string of characters at this time and then use PHP (as the mainstream development language now) to parse:
PLAIN textphp (as the current mainstream development language):
if (!empty ($_server[path_info])) {
$paths = Explode (/, substr ($_server[path_info], 1));
for ($i = 0, $cnt = count ($paths); $i < $cnt; $i + +)
$_get[$paths [$i]] = @ (string) $paths [+ + $i];
}
This makes it easy to convert path_info to a global $_get array, which has the benefit of
Http://www.myhost.com/foo.php (as the current mainstream development language)? a=a&b=b&c=c
Http://www.myhost.com/foo.php (as the current mainstream development language)/A/A/B/B/C/C
The above URL can be accessed at the same time, ensuring versatility
http://www.bkjia.com/PHPjc/508680.html www.bkjia.com true http://www.bkjia.com/PHPjc/508680.html techarticle last time I wrote the search Engine Friendly's URL design-I toss this thing, to achieve this http://www.myhost.com/foo.php (as the current mainstream development language)? a=ab=bc=c-http:// W ...