2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by diafol
0

RewriteEngine On
RewriteRule ^tags/([^/]*)\.html$ /tags.php?tag=$1 [L]

will give

http://www.site.com /tags/green+data+center.html

I'm not sure how to replace + with - though.

However, I did come across this for replacing a space with an underscore:

http://www.unitedforums.co.uk/vb/website-development-scripting/8920-mod_rewrite-replace-1-more-instances-character.html

RewriteCond %{REQUEST_URI} ^(.*)\ (.*)$
RewriteRule ^.*$ %1_%2 [E=space_replacer:%1_%2]
RewriteCond %{ENV:space_replacer} !^$
RewriteCond %{ENV:space_replacer} !^.*\ .*$
RewriteRule ^.*$ %{ENV:space_replacer} [R=301,L]

Perhaps you could modify this? Not sure wether it would replace all instances though

Edited by diafol: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.