mod-rewrite: Replacing some characters in a url

Posted by GeorgeCalm on Server Fault See other posts from Server Fault or by GeorgeCalm
Published on 2010-03-14T09:54:46Z Indexed on 2010/03/14 10:05 UTC
Read the original article Hit count: 1129

Filed under:
|

Is it possible to replace some forward slashes (/) of a URL to dots (.) in a RewriteRule? It doesn't have to be done exclusively with a RewriteRule, but definitely not with a script.

Example 1:

INPUT:  /document/my/document.html
OUTPUT: /document-my.document.html

Example 2:

INPUT:  /document/depth/of/path/can/vary.html
OUTPUT: /document-depth.of.path.can.vary.html

© Server Fault or respective owner

Related posts about apache

Related posts about mod-rewrite