Forum Moderators: phranque
to
www.site.com/galleries/Malaysia/Ipoh/img.php?pic=4
for instance.
I placed a .htaccess file in the www.site.com/galleries/Malaysia/Rest/ directory containing this line:
redirect 301 /galleries/Malaysia/Rest/img.php?pic=7 [site.com...]
and it didn't work. But for instance
redirect 301 /galleries/Malaysia/Rest/imagehtm/image7.htm [site.com...]
works and redirects from
[site.com...]
to
[site.com...]
Now, I checked and it appears that you have to encode somehow the url-path part:
[httpd.apache.org...]
I tried to url-encode /galleries/Malaysia/Rest/img.php?pic=7 obtaining
%2Fgalleries%2FMalaysia%2FRest%2Fimg.php%3Fpic%3D7
but even this didn't work. What can I do?
This should work in your root directory -- above "/galleries":
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^pic=7$
RewriteRule ^galleries/Malaysia/Rest/img\.php$ http://www.site.com/galleries/Malaysia/Ipoh/img.php?pic=4 [R=301,L]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^pic=7$
RewriteRule ^img\.php$ http://www.site.com/galleries/Malaysia/Ipoh/img.php?pic=4 [R=301,L]