.htaccess / url rewrite > Erreur 404.14 sur 1and1

Kepounet

Nouveau WRInaute
Bonjour à tous !

J'ai un problème avec le fichier .htaccess et l'url rewrite de 1and1. Je sais, ce n'est vraiment pas le meilleur hébergeur mais je n'ai pas d'autre solution étant donné que ce n'est pas moi qui l'ai pris. Bref, le problème se trouve sur cette page > http://www.shared-manga.com/lecture/ (pour que vous puissiez comprendre).

C'est un script de lecture en ligne. Quand l'on clique sur le lien, l'index.php situé dans le sous-répertoire lecture fonctionne. Mais au moment de choisir la bande dessinée en question, à savoir Shared dans la liste déroulante, le lien qui mène au fichier /lecture/mangas/Shared ne fonctionne pas.

C'est donc dû à un problème de .htaccess (situé dans le sous-répertoire lecture) que j'ai essayé de régler en naviguant sur plusieurs forums mais je n'ai pas réussit à trouver la solution. J'appelle donc à votre aide, vous ayant vaincu 1and1 ! Merci d'avance. Je vous met les codes des fichiers ci-dessous :

Fichier .htacsess :
RewriteEngine on
RewriteBase /lecture/

RewriteRule ^mangas/([^/]+)/([^/]+)/$ - [F,L]
RewriteRule ^mangas/([^/]+)/$ - [F,L]
RewriteRule ^mangas(/?)$ - [F,L]

RewriteRule ^([^/.]+)/([^/.]+)/([0-9]+)(/?)$ index.php?manga=$1&chapter=$2&page=$3 [L]
RewriteRule ^([^/.]+)/([^/.]+)(/?)$ index.php?manga=$1&chapter=$2 [L]
RewriteRule ^([^/.]+)(/?)$ index.php?manga=$1 [L]

Fichier index.php (situé dans le sous-répertoire lecture) :
<?php

require_once("config.inc.php");
require_once("functions.inc.php");


$theme = $omv_theme;

$manga = null;
$manga_escaped = null;

$chapter = null;
$chapter_number = null;
$chapter_number_escaped = null;
$previous_chapter = null;
$next_chapter = null;

$page = null;

$description = "";
$title = $omv_title;

$mangas = omv_get_mangas();
if (isset($_GET["manga"])) {
$manga_title = omv_decode($_GET["manga"]);
if (in_array($manga_title, $mangas)) {
$manga = $manga_title;
$manga_escaped = $_GET["manga"];
}
}

if ($manga) {
$description = "Read " . $manga . " Manga Online";
$title .= " - " . $manga;

$chapters = omv_get_chapters($manga);
if (isset($_GET["chapter"])) {
$chapter_number = omv_decode($_GET["chapter"]);
$index = omv_get_chapter_index($chapters, $chapter_number);
if ($index != -1) {
$chapter = $chapters[$index];
$chapter_number_escaped = $_GET["chapter"];
if ($omv_chapters_sorting == SORT_ASC) {
if ($index > 0) {
$previous_chapter = $chapters[$index - 1];
}
if ($index < (count($chapters) - 1)) {
$next_chapter = $chapters[$index + 1];
}
} else {
if ($index < (count($chapters) - 1)) {
$previous_chapter = $chapters[$index + 1];
}
if ($index > 0) {
$next_chapter = $chapters[$index - 1];
}
}
}
} else {
$chapter = $chapters[0];
$chapter_number = $chapters[0]["number"];
$chapter_number_escaped = omv_encode($chapter_number);

if (count($chapters) > 1) {
if ($omv_chapters_sorting == SORT_ASC) {
$next_chapter = $chapters[1];
} else {
$previous_chapter = $chapters[1];
}
}
}

if ($chapter) {
$pages = omv_get_pages($manga, $chapter["folder"]);
if (isset($_GET["page"])) {
$_page = intval($_GET["page"]);
if (($_page >= 1) && ($_page <= count($pages))) {
$page = $_page;
}
} else if (count($pages) > 0) {
$page = 1;
}

$title .= " - Chapter " . $chapter_number;

if ($page) {
$title .= " - Page " . $page;
}
}
}
?>
<!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>
<base href="<?php echo $omv_base_url ?>" />
<meta name="Keywords" content="<?php echo str_replace(' ', ',', $description) ?>" />
<meta name="Description" content="<?php echo $description ?>" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<title><?php echo $title ?></title>
<link rel="stylesheet" href="themes/<?php echo $theme ?>/omv.css" type="text/css" media="screen" />

<script type="text/javascript">
function change_manga(manga) {
if (manga != 0) {
document.location = "<?php echo $omv_base_url ?>" + manga;
}
}

function change_chapter(manga, chapter) {
if (manga != 0) {
document.location = "<?php echo $omv_base_url ?>" + manga + "/" + chapter;
}
}

function change_page(manga, chapter, page) {
if (manga != 0) {
document.location = "<?php echo $omv_base_url ?>" + manga + "/" + chapter + "/" + page;
}
}
</script>

</head>

<body>

<div id="omv">

<table>
<tr class="line">
<td class="up_left"><img src="themes/<?php echo $theme ?>/spacer.gif" alt="" /></td>
<td class="up"></td>
<td class="up_right"><img src="themes/<?php echo $theme ?>/spacer.gif" alt="" /></td>
</tr>
<tr>
<td class="mid_left"></td>
<td class="mid">
<table>
<tr>
<td>
<?php
$omv_pager = "";

$omv_pager .= "<div class=\"pager\">\n";

$omv_pager .= "<span>Manga <select name=\"manga\" onchange=\"change_manga(this.value)\">";
$omv_pager .= "<option value=\"0\">Select Manga Title...</option>";
for ($i = 0; $i < count($mangas); $i++) {
$m = $mangas[$i];
$omv_pager .= "<option value=\"" . omv_encode($m) . "\"" . (($m == $manga) ? " selected=\"selected\"" : "") . ">" . $m . "</option>";
}
$omv_pager .= "</select></span>\n";

if ($manga) {
if ($chapter) {
$omv_pager .= "<span>Chapter <select name=\"chapter\" onchange=\"change_chapter('$manga_escaped', this.value)\">";
for ($i = 0; $i < count($chapters); $i++) {
$cnumber = $chapters[$i]["number"];
$omv_pager .= "<option value=\"" . omv_encode($cnumber) . "\"" . (($cnumber == $chapter_number) ? " selected=\"selected\"" : "") . ">" . $cnumber . (isset($chapters[$i]["title"]) ? (" - " . $chapters[$i]["title"]) : "") . "</option>";
}
$omv_pager .= "</select></span>\n";

if ($page) {
$prevhtml = "";
if ($page <= 1) {
$prevhtml = "<img src=\"themes/$theme/no-previous.png\" alt=\"\" />";
} else {
$prevhtml = "<a href=\"$manga_escaped/$chapter_number_escaped/" . ($page - 1) . "\"><img src=\"themes/$theme/previous.png\" alt=\"Previous Page\" title=\"Previous Page\" /></a>";
}
$nexthtml = "";
if ($page >= count($pages)) {
$nexthtml = "<img src=\"themes/$theme/no-next.png\" alt=\"\" />";
} else {
$nexthtml = "<a href=\"$manga_escaped/$chapter_number_escaped/" . ($page + 1) . "\"><img src=\"themes/$theme/next.png\" alt=\"Next Page\" title=\"Next Page\" /></a>";
}

$omv_pager .= "<span>$prevhtml Page <select name=\"page\" onchange=\"change_page('$manga_escaped', '$chapter_number_escaped', this.value)\">";
for ($p = 1; $p <= count($pages); $p++) {
$omv_pager .= "<option value=\"" . $p . "\"" . (($p == $page) ? " selected=\"selected\"" : "") . ">#" . $p . "</option>";
}
$omv_pager .= "</select> of " . count($pages) . " $nexthtml</span>\n";
}
}
}

$omv_pager .= "</div>\n";

echo $omv_pager;
?>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td><?php
if ($manga) {
if ($chapter) {
if ($page) {
$img = "mangas/" . $manga . "/" . $chapter["folder"] . "/" . $pages[$page - 1];
$imgsize = omv_get_image_size($img);
$imghtml = "<img src=\"$img\" alt=\"\" width=\"" . $imgsize["width"] . "\" height=\"" . $imgsize["height"] . "\" class=\"picture\" />";

$prev_page_path = omv_get_previous_page($manga_escaped, $chapter_number_escaped, $page, $previous_chapter);
$next_page_path = omv_get_next_page($manga_escaped, $chapter_number_escaped, $page, count($pages), $next_chapter);

if ($next_page_path) {
$imghtml = "<a href=\"$next_page_path\">" . $imghtml . "</a>";
}
echo $imghtml;
} else {
echo "<div class=\"warn\">There is no selected page!</div>";
}
} else {
echo "<div class=\"warn\">There is no selected chapter!</div>";
}
} else {
echo "<div class=\"warn\">Select a manga title to get started!</div>";
}
?></td>
</tr>
<?php
if ($manga && $chapter && $page) {
?>
<tr>
<td>
<script type="text/javascript">
function omvKeyPressed(e) {
var keyCode = 0;

if (navigator.appName == "Microsoft Internet Explorer") {
if (!e) {
var e = window.event;
}
if (e.keyCode) {
keyCode = e.keyCode;
if ((keyCode == 37) || (keyCode == 39)) {
window.event.keyCode = 0;
}
} else {
keyCode = e.which;
}
} else {
if (e.which) {
keyCode = e.which;
} else {
keyCode = e.keyCode;
}
}

switch (keyCode) {
<?php
if ($prev_page_path) {
?>
case 37:
window.location = "<?php echo $omv_base_url . $prev_page_path ?>";
return false;

<?php
}
if ($next_page_path) {
?>
case 39:
window.location = "<?php echo $omv_base_url . $next_page_path ?>";
return false;

<?php
}
?>
default:
return true;
}
}
document.onkeydown = omvKeyPressed;
</script>
</td>
</tr>
<tr>
<td>
<?php
echo $omv_pager;
?>
</td>
</tr>
<?php
} else {
?>
<tr>
<td><br /></td>
</tr>
<?php
}
?>
</table>
</td>
<td class="mid_right"></td>
</tr>
<tr class="line">
<td class="down_left"></td>
<td class="down"></td>
<td class="down_right"></td>
</tr>
</table>

</div>

<div class="w3c">
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" width="88" height="31" /></a>
<a href="http://jigsaw.w3.org/css-validator/check?uri=referer"><img src="http://www.w3.org/Icons/valid-css.png" alt="Valid CSS 2.1" width="88" height="31" /></a>
</div>

</body>

</html>

Fichier config.php :
<?php

// URL where the script is installed, it must end with a slash
$omv_base_url = "http://www.shared-manga.com/lecture/";

// page title
$omv_title = "Lecture en ligne - Shared";

// supported image file types
$omv_img_types = array("jpg", "jpeg", "png", "bmp", "gif");

// chapters can be sorted by ascending or descending order
$omv_chapters_sorting = SORT_ASC; // SORT_ASC or SORT_DESC

// image auto-resizing
$omv_img_resize = true; // true or false
$omv_preferred_width = 800; // preferred width in pixels

// stylesheet name
$omv_theme = "default"; // theme's folder name

?>
 

Discussions similaires

Haut