Reputation: 190976
How do I change a period/dot (.) into a plus (+) of a match using mod_rewrite? My match is #2
.
This is my rule so far:
RewriteRule ^(.*)/(.*)-[0-9]*\.shtml$ http://kentwired.com/search/most-popular/?searchphrase=exact&searchword=$2 [L,R=301]
With my rules currently,
becomes
but I need
Upvotes: 2
Views: 514
Reputation: 655489
Try this:
RewriteRule ^([^.]*)\.(.*\.shtml)$ /$1+$2 [N]
RewriteRule ^.+/([^/]+)-[0-9]*\.shtml$ http://kentwired.com/search/most-popular/?searchphrase=exact&searchword=$1 [L,R=301]
Upvotes: 2