Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [CSS][MySQL][PHP]Błąd 404
Forum PHP.pl > Forum > Przedszkole
markaz
Witam wszystkich.
Mam problem tego typu że w sklepie internetowym którym mam administrować wyskakuje Błąd 404 The requested URL /sklep/produkty,poduszki-ogrodowe.html was not found on this server. Jak mogę usunąć tą usterkę?

Bardzo proszę o pomoc. Ja aż tak nie znam się na programowaniu dopiero się uczę PHP i wdrażam w to wszystko.

Pozdrawiam.
wookieb
No a skąd my mamy wiedzieć skoro nie wiemy nic poza twoja super cenną informacją "mam błąd 404" questionmark.gif
Na jakim silniku oparte, jaki rewrite, jak obsługiwane są linki.
markaz
http://hitgarden.com/sklep/ adres stronki. Silnik bazy MySql, serwer apatche. Strona jest napisana w php i w Javie. Mam również system CMS do obsługi tego sklepu ale niestety nie działa niewiem czy z tego powodu że wywala ten błąd 404.
Jeśli jeszcze jakieś info to podam.

Pozdrawiam
sadistic_son
WKLEJ KOD! Inaczej możemy Ci powróżyć z fusów co najwyżej!
pedro84
Mi to wygląda na problem z plikami htaccess.

Poza tym, Java != Javascript, a chyba o ten drugi Ci chodziło.

Cytat
Bardzo proszę o pomoc. Ja aż tak nie znam się na programowaniu dopiero się uczę PHP i wdrażam w to wszystko.
\
To po co sie bierzesz za coś na czym "aż tak się nie znasz"?
markaz
kod z index.php
<?php
session_start();
require_once('config.php');
include('includes.php');
$smarty -> display('index.tpl');

?>

kod z index.tpl


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
{if $site =='error404'}
<title>page not found - {$vars.siteTittle}</title>
{else}
<title>{if !empty($text.nazwa)}{$text.nazwa} - {/if}{$vars.siteTittle}</title>
{/if}
<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=utf-8" />
<meta name="description" content="{$vars.description}" />
<meta name="keywords" content="{$vars.keywords}" />
<meta name="Robots" content="index,follow" />
{$lang}
{* -- język -- *}
{if $lang == ''}
{config_load file="pl.tpl"}
{else}
{config_load file="`$lang`.tpl"}
{/if}

{* -- style -- *}
<link rel="StyleSheet" type="text/css" href="css/style.css"/>
<link rel="StyleSheet" type="text/css" href="css/datechooser.css"/>
<link rel="StyleSheet" type="text/css" href="css/thickbox.css"/>
{if $system == 'mac'}
<link rel="StyleSheet" type="text/css" href="css/style_mac.css"/>
{/if}

{* -- style dla Internet Exploler -- *}
<!--[if lt IE 7]>
<link rel="StyleSheet" type="text/css" href="css/style_ie.css"/>
<![endif]-->
<!--[if gte IE 7]>
<link rel="StyleSheet" type="text/css" href="css/style_ie7.css"/>
<![endif]-->
{* -- style lightbox -- *}
<link rel="StyleSheet" type="text/css" href="css/lightbox.css"/>

{include file="site/javascript.tpl"}
</head>
<body>
{if $site == "error404"}
{include file="site/error404.tpl"}
{elseif ($site == "thickbox")||($site == "rozmiar")}
{include file="site/thickbox.tpl"}
{else}
{include file="site/main.tpl"}
{/if}
</body>
</html>

plik htaccess mam w głównym katalogu ale jest on pusty właśnie nie wiem dlaczego.

chciałbym właśnie ten problem jakoś naprawić i się czegoś nauczyć

Pozdrawiam.
banki
linki masz zrobione pod mod rewrite, to do htaccesa zapewne musisz dopisać to
markaz
"banki" ale co mam wpisać do htaccesa?to co mam w index.tpl? czyli mam edytować tego htaccesa w głównym katalogu?
pedro84
Cytat(markaz @ 20.05.2010, 12:27:01 ) *
"banki" ale co mam wpisać do htaccesa?to co mam w index.tpl? czyli mam edytować tego htaccesa w głównym katalogu?

Żartujesz? No ULRe musisz "przepisać". Nie, nie to co w index.php. Mówiłem, nie bierz się za coś, o czym pojęcia zielonego nie masz.
wookieb
Pokaz zawartość swojego htaccess i który plik odpowiada za wyswietlanie kategorii?
markaz
plik htaccess w głównym katalogu jest pusty.
Plik produkty.php odpowiada za wyświetlanie kategori poniżej kod:

<?php

$kategoria = $var1;
$grupa = $var2;
$id = $var3;

if (empty($kategoria)){
$text = getOneWhere($langPrefix.'text', "sekcja = 'strona_glowna'");
}
else {
$text['nazwa'] = $vars['produkty_tytul'];
}


$list['kategorie'] = getListWhere($langPrefix.'kategoria', 'pozycja asc', "sekcja = 'produkty' and ukryty = 0");
$contents="sekcja/produkty.tpl";

if (!empty($kategoria)) {
$kategoria = getOneWhere($langPrefix.'kategoria', "link_id = '".$kategoria."'");
$list['grupy'] = getListWhere($langPrefix.'subtext', 'pozycja asc', "sekcja = 'produkty' and kategoria = '".$kategoria['id']."'and ukryty = 0");
$_SESSION['last_produkt']['kategoria'] = $kategoria['link_id'];

if (count($list['grupy']) == 1) {
if (empty($list['grupy'][0]['image'])){
$grupa = $list['grupy'][0]['link_id'];
$hide_submenu = true;
};
};

if (!empty($grupa)) {
$grupa = getOneWhere($langPrefix.'subtext', "link_id = '".$grupa."'");

$list['produkty'] = getListWhere($langPrefix.'kolor', 'pozycja asc', "parent_id = '".$grupa['id']."'and ukryty = 0");
$_SESSION['last_produkt']['grupa'] = $grupa['link_id'];

foreach ($list['produkty'] as $key => $listValue) {
$list['flas_info'].= $listValue['webimage']."|";
$list['flas_info'].= "produkty,".$kategoria['link_id'].",".$grupa['link_id'].",". $listValue['link_id'].".html;";
}

$list['flas_info'].= "&nograss=";
foreach ($list['produkty'] as $key => $listValue) {
if ($listValue['trawa'] == 0 ) {
$list['flas_info'].= "true;";
}
else {
$list['flas_info'].= "false;";
}
}
}

if (!empty($id)) {
$produkt = getOneWhere($langPrefix.'kolor', "link_id = '".$id."' and parent_id = '".$grupa['id']."'");
$_SESSION['last_produkt']['produkt'] = $produkt['link_id'];

$list['ceny'] = getListWhere($langPrefix.'cena', 'pozycja asc', "parent_id = '".$produkt['id']."'and ukryty = 0");

// //$cena['rozmiar'] =
//$rozmiar = getOneWhere($langPrefix.'rozmiar', "parent_id = '".$cena['rozmiar'] ."'");
// //$cena['image'] = getOneWhere($langPrefix.'images', "sekcja = 'rysunki_techniczne' parent_id = '".$cena['image'] ."'");
//$image = getOneWhere($langPrefix.'images', "sekcja = 'rysunki_techniczne' parent_id = '".$cena['image'] ."'");

foreach ($list['ceny'] as $key => $listValue) {
$temp = getOneWhere($langPrefix.'rozmiar', "id = '".$listValue['rozmiar']."'");
$list['ceny'][$key]['rozmiar'] = $temp['nazwa'];
$temp = getOneWhere($langPrefix.'images', "id = '".$listValue['image']."'");
$list['ceny'][$key]['image'] = $temp['image'];
$list['ceny'][$key]['nazwa_rysunek'] = $temp['nazwa'];
}

$produkt['cena'] = $list['ceny'];
$produkt['cena_count'] = count($produkt['cena']);
$produkt['flashvars']="images=".$produkt['webimage'].";".$produkt['image'].";".$produkt['nazwa'];
if ($produkt['trawa'] == 0 ) {
$produkt['flashvars'].= "&nograss=true";
}
$nextId =array();

foreach ($list['produkty'] as $key => $listValue) {
if($listValue['link_id'] == $id){
$nextId['id'] = $key;
}
}

$nextId['prev'] = $nextId['id'] - 1;
$nextId['next'] = $nextId['id'] + 1;

if ($nextId['prev'] < 0 ){
$nextId['prev'] = $list['produkty'][(count($list['produkty']) - 1)]['link_id'];
}
else {
$nextId['prev'] = $list['produkty'][$nextId['prev']]['link_id'];
}

if (!empty($list['produkty'][$nextId['next']])){
$nextId['next'] = $list['produkty'][$nextId['next']]['link_id'];
}
else {
$nextId['next'] = $list['produkty'][0]['link_id'];
}
}
}
else {
$image = getOneWhere($langPrefix.'images', "sekcja = 'strona_glowna_image' and parent_id = 0");
}

?>
wookieb
Więc sprawdź w swoim systemi jaki htaccess powinien działać w twoim serwisie. Możemy rozwiązać jeden problem ale przyjdą następne.
I UŻYWAJ BBCODE
markaz
Jeśli chodzi o przekierowania strony to w moim serwisie niema. A jak mogę sprawdzić rodzaj htaccess w moim serwisie? Strona jest na serwerze AZ.pl.

Pozdrawiam
wookieb
Powtarzam, dowiedz się jaka powinna być zawartość twojego pliku htaccess dla tego serwisu. Kropka.
Nie ma czegoś takiego jak rodzaj htaccess i nie chodzi tutaj o przekierowania.
markaz
znalazłem pliczek htacces z backapu wkleiłem i śmiga stronka. Ale mam jeszcze jedno pytanie. Chciałbym utworzyć teraz subdomenę z hitgarden.com/sklep na sklep.hitgarden.com. Co muszę zmienić w pliku htacces żeby się nie posypało? dziekuje za zainteresowanie moim tematem.
Z pliku htacces
RewriteEngine on

RewriteRule ^.+(/file/.+)$ http://www.hitgarden.com/sklep/$1 [L]
RewriteRule ^.+(flash/.+)$ $1 [L]
RewriteRule ^.+(xml/.+)$ $1 [L]
RewriteRule ^.+(js/.+)$ $1 [L][PHP][/PHP]
RewriteRule ^.+(img/.+)$ $1 [L]
RewriteRule ^.+(css/.+)$ $1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z-_0-9]+)/([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?lang=$1&site=$2&var1=$3&var2=$4&var3=$5&var4=$6&var5=$7 [L]
RewriteRule ^([a-zA-Z-_0-9]+)/([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?lang=$1&site=$2&var1=$3&var2=$4&var3=$5&var4=$6 [L]
RewriteRule ^([a-zA-Z-_0-9]+)/([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?lang=$1&site=$2&var1=$3&var2=$4&var3=$5 [L]
RewriteRule ^([a-zA-Z-_0-9]+)/([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?lang=$1&site=$2&var1=$3&var2=$4 [L]
RewriteRule ^([a-zA-Z-_0-9]+)/([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?lang=$1&site=$2&var1=$3 [L]
RewriteRule ^([a-zA-Z-_0-9]+)/([a-zA-Z-_0-9]+).html/?$ index.php?lang=$1&site=$2 [L]
RewriteRule ^([a-zA-Z-_0-9]+)/?$ index.php?lang=$1 [L]

RewriteRule ^([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?site=$1&var1=$2&var2=$3&var3=$4&var4=$5 [L]
RewriteRule ^([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?site=$1&var1=$2&var2=$3&var3=$4 [L]
RewriteRule ^([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?site=$1&var1=$2&var2=$3 [L]
RewriteRule ^([a-zA-Z-_0-9]+),([a-zA-Z-_0-9]+).html/?$ index.php?site=$1&var1=$2 [L]
RewriteRule ^([a-zA-Z-_0-9]+).html/?$ index.php?site=$1 [L]
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.