Menu

Navigation Doesn't Work - No Page Found

Help
2008-07-20
2012-03-29
  • Nobody/Anonymous

    thanks for your reply.

    I'm not sure how to modify thr .htaccess

    I tried both $cleanurls = true; & $cleanurls = false;

    but still the same problem, what should i change in the .htaccess ?

    This is what it looks like:

    this file is used if you configure your scuttle for nice urls

    (see $cleanurls in config.inc.php)

    Options +FollowSymlinks

    RewriteEngine On

    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L]

    If you have Scuttle in subdirectories e.g. http://www.example.com/myscuttle/links/

    then you need to comment the precedent line and remove comment of the following one

    (replace "myscuttle/links/" with your subdirectories name)

    RewriteRule ^([^/]+)/?(.*) myscuttle/links/$1.php/$2 [L]

    Rewrite clean URLs onto real files

    <IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f

    if cleanurls don't work, comment option 1 (by adding # at the beginning) and uncomment option 2:

    RewriteRule ^([^/]+)/?(.*) $1.php?query=$2 [L,QSA] #option 1

    RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L] #option 2

    </IfModule>

     
  • Arakel Collins

    Arakel Collins - 2008-07-20

    Hi again,

    sorry but I don't have enough time at the moment to go into this in detail.
    It seems, that you are using the original .htaccess.
    I had also some problems at the beginning with the URL and changed the .htaccess against the file from the Scuttle-project:

    Options +FollowSymlinks
    AcceptPathInfo On
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/]+)/?(.*) $1.php/$2 [L]

    Furthermore it was necessary for me to delete following lines in the constants.inc.php

    // Correct bug with PATH_INFO (maybe for Apache 1)
    if(strlen($_SERVER["PATH_INFO"])<strlen($_SERVER["ORIG_PATH_INFO"])) {
    $_SERVER["PATH_INFO"] = $_SERVER["ORIG_PATH_INFO"];
    }

    Maybe you can try this too.
    On the other hand, I didn't had a problem with an additional slash.
    Do other things running on your server without problem?

    Cheers,
    Arakel

     
  • Nobody/Anonymous

    Wow, you're taking the time to answer on your vacation? Thank you!

    You're almost there. The navigation works as long as no one is logged in after that it just piles on the urls to the page - if that make sense. It looks like this after login..

    http://www.example.com/populartags/bookmarks/joe

    after login navigation no longer works with or without clean urls...

    Here's what the function page looks like.


    <?php
    // UTF-8 functions
    require_once(dirname(FILE) .'/includes/utf8.php');

    // Translation
    require_once(dirname(FILE) .'/includes/php-gettext/gettext.inc');
    $domain = 'messages';
    T_setlocale(LC_MESSAGES, $locale);
    T_bindtextdomain($domain, dirname(FILE) .'/locales');
    T_bind_textdomain_codeset($domain, 'UTF-8');
    T_textdomain($domain);

    // Converts tags:
    // - direction = out: convert spaces to underscores;
    // - direction = in: convert underscores to spaces.
    function convertTag($tag, $direction = 'out') {
    if ($direction == 'out') {
    $tag = str_replace(' ', '', $tag);
    } else {
    $tag = str_replace('
    ', ' ', $tag);
    }
    return $tag;
    }

    function filter($data, $type = NULL) {
    if (is_string($data)) {
    $data = trim($data);
    $data = stripslashes($data);
    switch ($type) {
    case 'url':
    $data = rawurlencode($data);
    break;
    default:
    $data = htmlspecialchars($data);
    break;
    }
    } else if (is_array($data)) {
    foreach(array_keys($data) as $key) {
    $row =& $data[$key];
    $row = filter($row, $type);
    }
    }
    return $data;
    }

    function getPerPageCount() {
    global $defaultPerPage;
    return $defaultPerPage;
    }

    function getSortOrder($override = NULL) {
    global $defaultOrderBy;

    if (isset($_GET['sort'])) {
        return $_GET['sort'];
    } else if (isset($override)) {
        return $override;
    } else {
        return $defaultOrderBy;
    }
    

    }

    function multi_array_search($needle, $haystack) {
    if (is_array($haystack)) {
    foreach(array_keys($haystack) as $key) {
    $value =& $haystack[$key];
    $result = multi_array_search($needle, $value);
    if (is_array($result)) {
    $return = $result;
    array_unshift($return, $key);
    return $return;
    } elseif ($result == true) {
    $return[] = $key;
    return $return;
    }
    }
    return false;
    } else {
    if ($needle === $haystack) {
    return true;
    } else {
    return false;
    }
    }
    }

    function createURL($page = '', $ending = '') {
    global $cleanurls, $root;
    if ($page != '' && $ending !='') {
    // $page .= '.php'; // you need this if you are using $cleanurls=false
    return $root . $page .'/'. $ending;
    }
    else
    {
    return $root . $page .''. $ending;
    }
    }

    / Shorten a string like a URL for example by cutting the middle of it /
    function shortenString($string, $maxSize=75) {
    $output = '';
    if(strlen($string) > $maxSize) {
    $output = substr($string, 0, $maxSize/2).'...'.substr($string, -$maxSize/2);
    } else {
    $output = $string;
    }
    return $output;
    }

    function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '', $db = NULL) {
    if(defined('HAS_DIED'))
    die(T_('message_die() was called multiple times.'));
    define('HAS_DIED', 1);

    $sql_store = $sql;
    
    // Get SQL error if we are debugging. Do this as soon as possible to prevent 
    // subsequent queries from overwriting the status of sql_error()
    if (DEBUG &amp;&amp; ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) {
        $sql_error = is_null($db) ? '' : $db-&gt;sql_error();
        $debug_text = '';
    
        if ($sql_error['message'] != '')
            $debug_text .= '&lt;br /&gt;&lt;br /&gt;'. T_('SQL Error') .' : '. $sql_error['code'] .' '. $sql_error['message'];
    
        if ($sql_store != '')
            $debug_text .= '&lt;br /&gt;&lt;br /&gt;'. $sql_store;
    
        if ($err_line != '' &amp;&amp; $err_file != '')
            $debug_text .= '&lt;/br /&gt;&lt;br /&gt;'. T_('Line') .' : '. $err_line .'&lt;br /&gt;'. T_('File') .' :'. $err_file;
    }
    
    switch($msg_code) {
        case GENERAL_MESSAGE:
            if ($msg_title == '')
                $msg_title = T_('Information');
            break;
    
        case CRITICAL_MESSAGE:
            if ($msg_title == '')
                $msg_title = T_('Critical Information');
            break;
    
        case GENERAL_ERROR:
            if ($msg_text == '')
                $msg_text = T_('An error occured');
    
            if ($msg_title == '')
                $msg_title = T_('General Error');
            break;
    
        case CRITICAL_ERROR:
            // Critical errors mean we cannot rely on _ANY_ DB information being
            // available so we're going to dump out a simple echo'd statement
    
            if ($msg_text == '')
                $msg_text = T_('An critical error occured');
    
            if ($msg_title == '')
                $msg_title = T_('Critical Error');
            break;
    }
    
    // Add on DEBUG info if we've enabled debug mode and this is an error. This
    // prevents debug info being output for general messages should DEBUG be
    // set TRUE by accident (preventing confusion for the end user!)
    if (DEBUG &amp;&amp; ($msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR)) {
        if ($debug_text != '')
            $msg_text = $msg_text . '&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;'. T_('DEBUG MODE') .'&lt;/strong&gt;'. $debug_text;
    }
    
    echo &quot;&lt;html&gt;\n&lt;body&gt;\n&quot;. $msg_title .&quot;\n&lt;br /&gt;&lt;br /&gt;\n&quot;. $msg_text .&quot;&lt;/body&gt;\n&lt;/html&gt;&quot;;
    exit;
    

    }
    ?>


    Thanks again for your time!

    Kris

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.