I've been searching, reading and spent the last 8 days trying to figure out converting dynamic links to "pretty" links.
I starting using .htaccess and rewrite rules.
I have this basic code in my .htaccess file:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^pc-download/([0-9]+)/([^/]*)\.html$ /cgi/pc_read\.pl\?show=$1 [NC]
This will internally redirect my links to the proper cgi file and returns the item.
The problem I'm having is for external links in search results. From what I've read & read & read, I should be using the RewriteCond %{THE_REQUEST} and then a RewriteRule.
Since I've changed how my links are structured, I don't know if what I'm looking to do is even possible.
In the RewriteRule for internal links, the first part is "hard coded" ie, I make pc-download part of the code. Next ([0-9]+) is the item ID which is the variable ?show=$1. Here is the tricky part, ([^/]*) is an asset name that is in the database but not in the original (old) url. In the internal links, I have it coded in the page so any links in my pages automatically get generated.
So, here is the way I would like the external link to go:
External link : www.xyz.com/cgi/script.pl?show=001 Landing page : www.xyz.com/pc-download/001/name-of-product.html
I looked at maybe using RewriteMap. I created a txt file with the " ID Name Of Product " inside but putting that in my .htaccess file kills the whole website without even having a RewriteRule active.
Am I just spinning my head for nothing or am I headed down the right path?