DavidGP Posted February 16, 2009 Share Posted February 16, 2009 Ok, so I'm somewhat a novice to PHP but I know how to do this in PHP with; $nospaces = str_replace('-', '', $input); But I'd like to try to do this server side with regular expressions. I'm using isapi rewrite on a win2003 server with IIS. I have the current URL: http://www.gamerzunite.com/content.php?showtopic=Killzone 2 Preview Which gets translated to this: http://www.gamerzunite.com/Killzone 2 Preview I couldn't find a way in PHP to do this without losing the ability to pull the data from MySQL without the "exact" title with spacing and all. Code on the server I need to manipulate: RewriteRule ^/(~)([^/.\?]+)(?!\.php)$ /content.php?showtopic=$2 RewriteRule ^/([^/.\?]+)$ /content.php?showtopic=$1 So what would it involve changing the above code to insert dashes instead of spacing? Thanks. Link to comment https://forums.phpfreaks.com/topic/145431-replacing-whitespace-with-dashes-in-url-seo-friendly/ Share on other sites More sharing options...
DavidGP Posted February 16, 2009 Author Share Posted February 16, 2009 Nevermind, I figured it out with php. This topic can be closed. Link to comment https://forums.phpfreaks.com/topic/145431-replacing-whitespace-with-dashes-in-url-seo-friendly/#findComment-763466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.