Author Topic: How to write ( str_replace )  (Read 395 times)

0 Members and 1 Guest are viewing this topic.

Offline egturnkeyTopic starter

  • Enthusiast
  • Posts: 89
    • View Profile
How to write ( str_replace )
« on: March 14, 2010, 05:41:06 AM »
hello dear friends,

If i have

$manal "thank you for help";

and

$URL "siteroot/index.php?r$id";

then i will create a URL but i will remove whitespace

$manal str_replace('  ''-'trim($manal));

then i will make the link as follow

$URL "siteroot/$manal-$id.html";

but it needs .htaccess Okay then let say

Code: [Select]
RewriteRule -(.*)\.html index.php?r=$1

NOW the problem it won't works and works only if i removed
$manal str_replace('  ''-'trim($manal));
so is there any prblem with .htaccess and str_replace or am i did something wrong !!

thanks

Offline wildteen88

  • Guru
  • 'Insane!'
  • *
  • Posts: 12,021
  • Gender: Male
    • View Profile
Re: How to write ( str_replace )
« Reply #1 on: March 14, 2010, 06:23:11 AM »
Its most probably your rewrite rule that is the issue,
Code: [Select]
RewriteRule -(.*)\.html index.php?r=$1
Change the above to
Code: [Select]
RewriteRule ([0-9]+).html$ index.php?r=$1