2
我想知道是否有可能重写一个专为重写而设计的URL,如下所示:htaccessPHP替换URL中的变量
我的网址:http://example.com/page.php?page=5&action=something
但我想改变的URL:example.co米/页/ 5 /东西
这只是在href,htaccess的位就解决了。
我想知道是否有可能重写一个专为重写而设计的URL,如下所示:htaccessPHP替换URL中的变量
我的网址:http://example.com/page.php?page=5&action=something
但我想改变的URL:example.co米/页/ 5 /东西
这只是在href,htaccess的位就解决了。
function rewritelink($link){
$link = str_replace('.php','', $link);
$pattern = "/\?[^=]*=/";
$replacement = '/';
$link = preg_replace($pattern, $replacement, $link);
$pattern = "/\&[^=]*=/";
$replacement = '/';
$link = preg_replace($pattern, $replacement, $link);
return $link;
}
什么阻止你做手动? – 2010-09-06 09:49:45
什么都没有,只是想知道是否有通过PHP来实现的方法:) – ITg 2010-09-06 09:50:15
我只是需要用'/'来替换?page =基本上,但即使页面与动作不一样 – ITg 2010-09-06 09:51:10