Forum Moderators: phranque
The main worry however is that your method will be picked up by search engines and your site penalised because you are sending pages to Google which you don't let visitors see. e.g. a visitor for 'dog bones' will be sent directly to the right page anyway, and if he's not then you should solve the problem by improving your SEO for the right page so that he is next time.
1. Can you provide me with an example of how to do this using either .htaccess or php?
2. I only want to redirect using a couple of search phrases, (i.e., "dog bones" and "cat food"). Will such limited us also penalize my site by Google?
Thanks.
====================================
Put a space before!, this board removes them.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)$ /path_to/your_search_script [L]
"your_search_script" will be responsible for correctly directing the request to the appropriate output. So if the product contains "dog bones" in the title, all you really need to to is look it up and populate "my_product_id" with the product id used by your system and continue with output.
You won't be penalized so long as the visitor gets the same output as the search engine.