开发者

404 on direct access of page but not after visiting other page

I get message "The requested URL /schaak-demo was not found on this server" when trying to go to http://enkelzijdig.nl/schaak-demo. Does not matter how many times i try. Same goes for the link with www.

When i go to http://enkelzijdig.nl/demo/ first, and then to the link from the first paragraph, it works like a charm. Every time after that it works like a charm. After deleting cookies it still works. After closing the browser and starting up again it still works.

How come?

My .htaccess looks like this

### demo   
RewriteCond $1 !css/  
RewriteCond $1 !sites/  
RewriteCond $1 !skins/   
RewriteCond $1 !config/   
RewriteRule demo/(.*) /demo/php/$1 [L]    

In my configfile i get the website-URL, and i do it like this:

function set_path_to_client_website(){
    $servername = parse_url($_SERVER['SERVER_NAME']);
    $serveruri = parse_url($_SERVER['REQUEST_URI']);
    $_SESSION['host'] = $servername['path'];
    //if string 开发者_如何学Gobetween first and second slash ends with demofolder then add this part of the string to the session[host].
    $pos = strpos(strtolower($serveruri['path']), strtolower(substr(get_demo_folder(),1,-1))); 
    if ($pos > -1){
        $_SESSION['host'] = $servername['path'] . substr(strtolower($serveruri['path']), 0, $pos + strlen(get_demo_folder()) -1);
    } else{
        $_SESSION['host'] = $servername['path'] . '/';
    }
    return $_SESSION['host'];
}

Is this enough info? I am lost. Any hint is appreciated. Thank you.

Kim Alders


http://enkelzijdig.nl/schaak-demo/ (with trailing slash) works. Did you try to add Options -MultiViews to your .htaccess file?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜