I have this on my error log.

GET /wall/roves/378 HTTP/1.1" 404 212
i know it means that page its not found but i cant figure out why? its an Apache thing?

Member Avatar for diafol

404:

This is the most easily recognized error message. It states that the URI requested does not exist on the server.

Have you checked your paths? Is the site live? Want to share the url?

yes i checked the paths. they are ok. no i am working on the site locally havent uploaded yet.

<a href="<?php echo $base_url ?>roves/<?php echo $msg_id; ?>" style="font-weight:bold"><?php echo $message;?></a>

when i hove over the link i get the id right example localhost/wall/roves/345

when i try this

<a href="<?php echo $base_url ?>roves.php" style="font-weight:bold"><?php echo $message;?></a>

without the id that is, it opens a page

further more
i use this



<a href='<?php echo $base_url ?>**status/<?php echo $msg_id; ?>**' class="timeago" title='<?php echo $mtime; ?>'></a>

and it works on the status page, but not on the roves page

Member Avatar for diafol

The url: wall/roves/378

looks as though it deends upon Apache mod_rewrite.

wall/roves.php should work if this is indeed the path to the file roves.php
However, if your .htaccess rewrite code is a bit off, then I would imagine that your server wouldn't know where to find roves/378 - so it's probably looking for a roves directory and a file called 378 (with no extension).

Perhaps something like this...

RewriteEngine On
RewriteRule ^roves/([^/]*)$ /roves.php?id=$1 [L]

This assumes the querystring parameter value of 378 is assigned to the 'key' of 'id'. So your php code can do this at the url wall/roves/378 :

echo $_GET['id']; //outputs 378

aha. yes roves.php works. i use wamp server.

this is the mod_rewrite file

/* Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @file  mod_rewrite.h
 * @brief Rewrite Extension module for Apache
 *
 * @defgroup MOD_REWRITE mod_rewrite
 * @ingroup APACHE_MODS
 * @{
 */

#ifndef MOD_REWRITE_H
#define MOD_REWRITE_H 1

#include "apr_optional.h"
#include "httpd.h"

/* rewrite map function prototype */
typedef char *(rewrite_mapfunc_t)(request_rec *r, char *key);

/* optional function declaration */
APR_DECLARE_OPTIONAL_FN(void, ap_register_rewrite_mapfunc,
                        (char *name, rewrite_mapfunc_t *func));

#endif /* MOD_REWRITE_H */
/** @} */

in which file should i write ?
RewriteEngine On
RewriteRule ^roves/([^/]*)$ /roves.php?id=$1 [L]

and what about if i want to make other links? i 'll mess with the apache files each time?

Member Avatar for diafol

.htaccess in your public/html root directory

What other links? In that case you just use placeholders for filenames to directories. Research Apache rewrite directives:

http://borkweb.com/story/apache-rewrite-cheatsheet

thanks man i got it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.