Forum Moderators: DixonJones
I am trying to implement GWO using A/B testing whilst having a single physical page with multiple virtual versions. This means I have various includes within my file pulling up the different variatons that I require as shown below:
Original - [mysite.com...]
Variation 1 - [mysite.com...]
Variation 2 - [mysite.com...]
Variation 3 - [mysite.com...]
These pages parse the variable id as well so once the experiment is running, if I go to the address [mysite.com...] it redirects to [mysite.com...] - just as required.
My problem however lies within my htaccess user friendly urls which are in the format [mysite.com...] and cannot be changed for SEO purposes.
If I go to the address [mysite.com...] it simply redirects to [mysite.com...] without the id placed in there. It is confusing me as the rewriterule returns [mysite.com...] from the furl just as it should but Googles javascript is not doing what it usually does without the rewriterule.
Does anyone have any ideas regarding this?
I have searched and found a few people with this issue but no accurate replies.
Thanks,
Dave
Have you tried appending the "variation=" and/or "id=" parameter to the friendly URLs you request, as in "example.com/product/123/?variation=a"? There is a chance that the RewriteRule may be coded in such a way as to allow the additional parameter to pass through the rule, resulting in a server filepath of /product.php?id=123&variation=a.
It may be helpful to you to observe the HTTP transactions between your browser and your server. The "Live HTTP Headers" add-on for Firefox/Mozilla can be quite useful for this.
Another thing that may be helpful is to realize that with SEO-friendly rewriting in place, the URL is example.com/product/123. /product.php?id=123 should now exist only as a server filepath, and should not be 'published' on the Web or visible to the client (or to your client-side JS code).
Neither should it be directly-accessible by the client; any attempt to access example.com/product.php?id-123 should result in a 301-Moved Permanently redirect to example.com/product/123. However, it would not surprise me if this were not implemented properly, as most "SEF plug-in" writers don't understand the difference between URLs on the Web and filepaths within servers. As a result, they often omit this step.
In summary, if your search-engine friendly URL handling is properly implemented on your server, then your client side JavaScript should never see a URL in the "product.php?this=that" format. So in fact, what you're trying to do may not be possible unless the RewriteRule is coded to allow "example.com/product/123/?variation=a" to "work" as needed for your a/b testing, rather than being coded to force URL canonicalization as required to avoid duplicate content problems.
Jim
I see what you mean. My rewrites DO currently allow example.com?product.php?id=1 as well as example.com/product/1/. I thought it best to keep both in place in order to maximize listed pages but I guess I should only want the optimised urls to show so I will look into changing that. Do you know of any good documentation regarding that?
In order to solve my other problem I guess I need to get example.com/product/1/?variation=a to work first.
Thanks for your help.
Dave