I have access to httpd.conf
Then you can use a
RewriteMap, either a text file or (PHP) program.
For a text file map you would add
- Code: Select all
RewriteMap oldtonew txt:/path/to/map.txt
to your httpd.conf file, and create a text file (map.txt) with the new and old URLs
- Code: Select all
# Old New
koi-fish-vector-pack /category/sub-category/koi-fish-vector-pack
and the following to your .htaccess file
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond ${oldtonew:$1|failed} ^(/.+)$
RewriteRule ^catalog/([^/]+)\.html$ %1 [R=301,L]
For a program you would use
- Code: Select all
RewriteMap oldtonew prg:/path/to/map.php
and instead of a text file you would write a program that returned to new URL (map.php).