Forum Moderators: phranque
(I'm asking because if you are looking for a general solution to using search-engine-friendly URLs for dynamically-generated files, then what you've requested is actually backwards).
Jim
This is a one-off situation. The site has already been re-written in PHP from ColdFusion, and can now take advantage of SEO-friendly URL's...oh, and the DNS transfer is about to take place! ;-)
There are only about 8 dynamic URL's in the old site (it is not a huge ecommerce thing by any means), so it will be straightforward enough to just write a rule for each url. So, theoretically I am looking for someting along these lines, although I know that this is not correct because mod_rewrite cannot interpret the query string this way:
Redirect 301 /band/index.cfm?fuseaction=home.audio h**p://www.examplesite.com/audio
You will need mod_rewrite to do this. The first two directives are only needed if you don't already have working mod_rewrite code in this .htaccess file. The first may not be needed at all, or it may be required. Only testing can determine this, since server configurations vary.
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{QUERY_STRING} ^fuseaction=home\.audio$
RewriteRule ^band/index\.cfm$ http://www.example.com/audio [R=301,L]
Thanks for your reply, this looks perfect, but yet it is not working, i just get a 404 at the old URL. Maybe it has something to do with the existing rewrite rule? Here's what I have:
RewriteEngine On
RewriteBase / RewriteCond %{QUERY_STRING} ^fuseaction=home\.audio$
RewriteRule ^band/index\.cfm$ h**p://www.example.com/audio [R=301,L]
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)$ index.php/$1/ [L]
If this looks ok, it might have something to do with the PHP framework that the site is built with...The second rule you see above is what allows the PHP framework to generate SEO-friendly URL's...otherwise they would look like "/index.php/audio"