probleem met mod_rewrite
ik heb de volgend ecode in mijn htaccess:
RewriteEngine on
RewriteRule ^([a-zA-Z0-9_]*)/([a-zA-Z0-9_ ]*)$ news.php?actie=$1&id=$2
nu kijk ik op:
http://deepbeats.nl/test/news/
doet ie het
echter klik ik op een link dan doet ie helemaal niks
wie weet wat er mis is?:
news.php code
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?
echo"<table align='center' class='rechts' cellspacing= '0' >
<tr>
<td class=rechts>
<a href='?page=news'><font class=white>News</a>
</td>
</tr></table>";
echo"<table class=rechts2 cellspacing=1 align=center><tr>
<td valign=top>";
$sql = "SELECT * FROM WNP_main WHERE datum = NOW()ORDER BY id DESC ";
$query = mysql_query($sql);
$aantal = mysql_num_rows($query);
if(!isset($_GET['pagina']))
{
$page = 1;
}
else
{
$page = $_GET['pagina'];
}
$max_results = 46;
$from = (($page * $max_results) - $max_results);
$sql = "SELECT
id,titel, datum,DATE_FORMAT(datum,'%d-%m') AS datums
FROM
WNP_main
ORDER BY
id desc
LIMIT
$from, $max_results";
$query = mysql_query($sql) or die("Fout met MySQL-Database<br>We proberen het snel op te lossen!");
echo"<table class=rechts3 cellspacing=1 align=center><tr>
<td>";
while ($show = mysql_fetch_object($query))
{
echo "<font size='1' class=droze2>$show->datums</font> <a href=\"read/$show->id/\">$show->titel</a><br>";
}
// Figure out the total number of results in DB:
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM WNP_main"),0);
// Figure out the total number of pages. Always round up using ceil()
$total_pages = ceil($total_results / $max_results);
// Build Page Number Hyperlinks
echo "<br><center>";
// Build Previous Link
if($page > 1)
{
$prev = ($page - 1);
echo "<a href=\"?page=news&pagina=$prev\"><< </a>";
}
for($i = 1; $i <= $total_pages; $i++)
{
if(($page) == $i)
{
echo "$i ";
}
else
{
echo "<a href=\"?page=news&pagina=$i\">[$i]</a>";
}
}
// Build Next Link
if($page < $total_pages)
{
$next = ($page + 1);
echo "<a href=\"?page=news&pagina=$next\">>></a>";
}
echo"</td>
</tr>
</table>";
if($_GET['actie'] == "read")
{
$sql = "SELECT *,DATE_FORMAT(datum,'%d-%m') AS datums FROM WNP_main WHERE id='".$_GET['id']."' ";
$query = mysql_query($sql);
while ($show = mysql_fetch_object($query))
{
echo"<div class=txt>";
$show->nieuws2 = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<b><a href=\"\\1\" target=_blank>\\2</a><b/>",$show->nieuws2);
$show->nieuws2 = preg_replace('/(?<!\S)((http(s?):\/\/)|(www\.))+([\w.\/&=?\-~%;]+)\b/i', '<a href="http$3://$4$5" target="_blank">$4$5</a>', $show->nieuws2);
$show->nieuws2 = nl2br($show->nieuws2);
echo "<b>$show->datums. $show->nieuws1</b><br><br>";
echo "$show->nieuws2";
}
}
?>
echo"<table align='center' class='rechts' cellspacing= '0' >
<tr>
<td class=rechts>
<a href='?page=news'><font class=white>News</a>
</td>
</tr></table>";
echo"<table class=rechts2 cellspacing=1 align=center><tr>
<td valign=top>";
$sql = "SELECT * FROM WNP_main WHERE datum = NOW()ORDER BY id DESC ";
$query = mysql_query($sql);
$aantal = mysql_num_rows($query);
if(!isset($_GET['pagina']))
{
$page = 1;
}
else
{
$page = $_GET['pagina'];
}
$max_results = 46;
$from = (($page * $max_results) - $max_results);
$sql = "SELECT
id,titel, datum,DATE_FORMAT(datum,'%d-%m') AS datums
FROM
WNP_main
ORDER BY
id desc
LIMIT
$from, $max_results";
$query = mysql_query($sql) or die("Fout met MySQL-Database<br>We proberen het snel op te lossen!");
echo"<table class=rechts3 cellspacing=1 align=center><tr>
<td>";
while ($show = mysql_fetch_object($query))
{
echo "<font size='1' class=droze2>$show->datums</font> <a href=\"read/$show->id/\">$show->titel</a><br>";
}
// Figure out the total number of results in DB:
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM WNP_main"),0);
// Figure out the total number of pages. Always round up using ceil()
$total_pages = ceil($total_results / $max_results);
// Build Page Number Hyperlinks
echo "<br><center>";
// Build Previous Link
if($page > 1)
{
$prev = ($page - 1);
echo "<a href=\"?page=news&pagina=$prev\"><< </a>";
}
for($i = 1; $i <= $total_pages; $i++)
{
if(($page) == $i)
{
echo "$i ";
}
else
{
echo "<a href=\"?page=news&pagina=$i\">[$i]</a>";
}
}
// Build Next Link
if($page < $total_pages)
{
$next = ($page + 1);
echo "<a href=\"?page=news&pagina=$next\">>></a>";
}
echo"</td>
</tr>
</table>";
if($_GET['actie'] == "read")
{
$sql = "SELECT *,DATE_FORMAT(datum,'%d-%m') AS datums FROM WNP_main WHERE id='".$_GET['id']."' ";
$query = mysql_query($sql);
while ($show = mysql_fetch_object($query))
{
echo"<div class=txt>";
$show->nieuws2 = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<b><a href=\"\\1\" target=_blank>\\2</a><b/>",$show->nieuws2);
$show->nieuws2 = preg_replace('/(?<!\S)((http(s?):\/\/)|(www\.))+([\w.\/&=?\-~%;]+)\b/i', '<a href="http$3://$4$5" target="_blank">$4$5</a>', $show->nieuws2);
$show->nieuws2 = nl2br($show->nieuws2);
echo "<b>$show->datums. $show->nieuws1</b><br><br>";
echo "$show->nieuws2";
}
}
?>
Gewijzigd op 13/06/2005 15:07:00 door Pipo de clown
je hebt daar geen rewrite regel voor aan gemaakt
wat doe ik hier dan
RewriteRule ^([a-zA-Z0-9_]*)/([a-zA-Z0-9_ ]*)$ news.php?actie=$1&id=$2
RewriteRule ^(.*?)/(.*?)/ news.php?actie=$1&id=$2
RewriteRule ^(.*?)/(.*?) news.php?actie=$1&id=$2
ik begrijp er niks van