I wonder if there’s easy way to let apache2 support URL rewrite to special schemes like “macappstore”, “itms” and so on.
RewriteRule ^/pbmac-test$ macappstore://itunes.apple.com/us/app/id420133782 [R,L]
http://TLD/pbmac-test will be rewrote as http://TLD/macappstore://itunes.apple.com/us/app/id420133782
mod_rewriteis not detectingmacappstoreas a valid protocol for an absolute URI. Seeis_absolute_uriin mod_rewrite.c for more details.This leads it to treat your target URI as relative rather than absolute. The
Rflag will prepend the current protocol, server name and port to the relative URIs in order to produce RFC correct redirect headers as documented.For redirects as simple as the one you presented, you can use mod_alias instead: