Forum Moderators: phranque
I have 3 real page :
a.html
b.html
c.html
I need to make this:
when user call a.html OR aa.html OR aaa.html I need to open always page a.html
when user call b.html OR bb.html OR bbb.html I need to open always page b.html
when user call c.html OR cc.html OR ccc.html I need to open always page c.html
--
I can make all rules on .htaccess as
RewriteEngine on
RewriteRule aa.html a.html?o=aa
RewriteRule aaa.html a.html?o=aaa
But would like to try rewritemap for this, think better as solutions
Any example to rewritemap applicated on this ?
Thanks
value_to_check replacement like
aa a
aaa a
bb b
bbb b And the cirectives in your httpd.conf could look like
RewriteEngine on
# defining a map called 'lookup'
RewriteMap lookup txt:/var/www/maps/map.txt
#
# (2) look-up the map with the value stored in $1
RewriteCond ${lookup:$1} ^(.+)
# (1) get aa from r->uri /aa.html and store it in $1 ; (3) substitute with the map-result (if there was one)
RewriteRule ^/([^/.]+)\.html$ /%1.html [L]