rewrite rule + alias

Use GitHub to post bug reports and error descriptions for phpwcms. Describe your problem detailed!
Locked
tcm
Posts: 7
Joined: Fri 9. Jan 2004, 12:37

rewrite rule + alias

Post 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?
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

did you make a .htacces file?
http://www.studmed.dk Portal for doctors and medical students in Denmark
tcm
Posts: 7
Joined: Fri 9. Jan 2004, 12:37

Post by tcm »

sure:

RewriteEngine on
RewriteRule ^(.*)\.html$ %{DOCUMENT_ROOT}/index.php?id=$1
RewriteRule ^index.html$ %{DOCUMENT_ROOT}/index.php
tcm
Posts: 7
Joined: Fri 9. Jan 2004, 12:37

Post 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); 
} 
tcm
Posts: 7
Joined: Fri 9. Jan 2004, 12:37

Post by tcm »

ähm Oliver...


könntest du dies im nächsten release mit reinmachen?
Florian
Posts: 119
Joined: Wed 19. Nov 2003, 16:50
Location: Hamburg
Contact:

Post 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 :oops:.
Sorry for that.

Cheers,
Florian
Locked