First time using mod_rewrite and would really appreciate some help. I am using: Options +FollowSymLinks RewriteEngine on RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)\.html$ searchresult.php?cat_id=$2[L] RewriteRule ^madeupword/([a-zA-Z0-9_-]+)/([0-9]+)\.html$ article.php?art_id=$2[L] Code (markup): This make the links work like this: [url]http://www.mysite.com/Pasta-articles/24.html[/url] [url]http://www.mysite.com/madeupword/How-to-pasta/581.html[/url] Code (markup): This seems to work fine but the problem is, my url's are generated dynamically and for me to change them to static links there are spaces between the words. So the static link looks like this: [url]http://www.mysite.com/Pasta%20articles/24.html[/url] Code (markup): Instead of this: [url]http://www.mysite.com/Pasta-articles/24.html[/url] Code (markup): How can I change this code to replace a space(%20) with a dash(-)? <a href="madeupword/<?php echo $artrow_jok["art_title"]; ?>/<?php echo $artrow_jok["art_id"]; ?>.html"><?php echo $artrow_jok["art_title"]; ?></a> Code (markup):
<a href="madeupword/<?php echo str_replace(' ','-',str_replace('%20','-',$artrow_jok["art_title"])); ?>/<?php echo $artrow_jok["art_id"]; ?>.html"><?php echo $artrow_jok["art_title"]; ?></a> PHP:
Excellent!!! Thank you very very much Does the rest of the .htacces content look ok to you? I have no idea why it even works, I got most of that from other people's examples.