Forum Moderators: phranque
There is a CMS system on the site, and when product pages are created the url is something like -
www.domain.uk.com/index.php?pid=99
The same page is also accessable when you go to -
www.domain.uk.com/Products/99/Page-Title.html
Now I was wondering if its possible to set 301 redirects on the dynamic pages to the statics, therefore easier for Google to index all the pages on the site.
The only problem is that the static urls contain the page title, and im not sure how id go about adding that in on the htaccess.
Any know if this is possible/how to do it?
In general, the "plug-in" approach satisfies two of the three requirements for complete implementation. The plug-in modifies the links on your pages to link to the "static" SEO-friendly URL, and it also installs .htaccess code to "re-connect" the friendly URL with the correct server filepath (which used to be the URL), so that pages can be served.
The third requirement, needed on established sites with many existing and important back-links, is to redirect only direct client requests for the old unfriendly URLs to the new friendly ones. But since .htaccess has no access to your database, it is not capable of "creating" the "Page-title" information needed to form the new, friendly URL. So, again, we need a script that can access the database to look up this information. This script can be a separate one, or you can build this function into your existing script.
But any way you look at it, two of the three steps needed for a complete solution must be done using scripts which are capable of doing database lookups. Only one --the internal rewriting of the new friendly URL requests to the correct server filepath-- can be done in .htaccess.
Jim