Page 1 of 1
rewrite rule + alias
Posted: Mon 12. Jan 2004, 22:42
by tcm
If i use $phpwcms["rewrite_url"] = 1 then the link with alias doesn't work.
[ID plaetzchen]read news[/ID]
is produce this:
http://localhost:81/etzchen.html
any Ideas?
Posted: Mon 12. Jan 2004, 23:11
by frold
did you make a .htacces file?
Posted: Mon 12. Jan 2004, 23:20
by tcm
sure:
RewriteEngine on
RewriteRule ^(.*)\.html$ %{DOCUMENT_ROOT}/index.php?id=$1
RewriteRule ^index.html$ %{DOCUMENT_ROOT}/index.php
Posted: Tue 13. Jan 2004, 10:46
by tcm
I have it!!!
in .htacess you write:
RewriteEngine on
RewriteRule ^([a-z]*)\.html$ %{DOCUMENT_ROOT}/index.php?$1
RewriteRule ^(.*)\.html$ %{DOCUMENT_ROOT}/index.php?id=$1
RewriteRule ^index.html$ %{DOCUMENT_ROOT}/index.php
and in include\inc_front\front.func.inc.php
replace the function url_search with this:
Code: Select all
function url_search($query)
{
if(strpos($query, "id")) $noid = substr($query, 4);
else $noid = substr($query, 1);
$file = str_replace(",", ".", $noid).".html"; //further use
//$file = $noid.".html";
$link = "<a href=\"".$file."\"";
return($link);
//unset($link);
}
Posted: Tue 13. Jan 2004, 10:47
by tcm
ähm Oliver...
könntest du dies im nächsten release mit reinmachen?
Posted: Tue 13. Jan 2004, 19:59
by Florian
Hello
Oh shit. I bugfixed the mod_rewrite for myself long time ago in a kind of described above and forgot to publish
.
Sorry for that.
Cheers,
Florian