+ -
当前位置:首页 → 问答吧 → Godaddy 空间 Rewrite模式 __URL__问题

Godaddy 空间 Rewrite模式 __URL__问题

时间:2011-09-26

来源:互联网

Godaddy的Linux空间:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

增加了红色部分,Rewrite才正常

发现 系统常量却不正常了
访问 /member/index/login
<form action="__URL__ /checkLogin">
变成了 /member/index/member/index/checkLogin
出现了两个 /member/index

作者: kyosing   发布时间: 2011-09-26

无奈在入口文件强制加入:
$c_url = explode('/',$_SERVER['PHP_SELF']);
if(count($c_url)>3){
    $action_hhj = '/'.$c_url[1].'/'.$c_url[2];
    define("__URL__",$action_hhj);
}

作者: kyosing   发布时间: 2011-09-26