Hi all, I am sorry if I have posted this in the incorrect place but I couldn't see an Apache section.
I am working on some ReWrites and ReDirects in my htaccess file, my reason for doing this is because I am developing a new design and layout for an existing website therefore I need to redirect to keep hold of the google rankings etc.
So the old (existing) URL looks like this:
/news/internet-shopper-numbers-continue-to-grow-$21378232.htm
and the new URL will look like this:
/industry-news/small-business-website-design/internet-shopper-numbers-continue-to-grow/800715788
in the old URL "internet-shopper-numbers-continue-to-grow" is dynamically generated
where as in the new URL "small-business-website-design", "internet-shopper-numbers-continue-to-grow", and "800715788" are all dynamically generated.
So my issue is how do I get from 1 URL to another if only 1 of the dynamically generated variables is available. I was thinking perhaps it would be a good idea to do a PHP redirect instead where I can get the data from the URL process through database to get all data needed to generate the new URL, but im not sure if this is good practice, this would also mean having to match the old url file directory which is not the current case.
I'm guessing I start with something like this:
Options +FollowSymlinks
RewriteEngine On
RewriteCond /news/%{QUERY_STRING}(.)(\\d+)(.)(htm)$
RewriteRule ^industry-news/(.+)/%1/(\d{9})
I know this is very basic and kinda wrong but I'm working on this for the first time and im stumped.
Hope someone can help,
Cheers guys.