Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a large number of URLS where I need to specify rel="canonical", The URL structure is like:

example.c.o.m/abcd?q=ccccc&location=ffff&x=pp&y=qq

I need to strip the last two parameters (&x=pp&y=qq) and show example.com/abcd?q=ccccc&location=ffff as my canonical link in the header.

I have this as moz reference and tried various ways with mod_RewriteRule. I'm looking for either a htaccess solution or that of one that works with Joomla CMS.

share|improve this question
add comment

1 Answer 1

Setting up canonical links is done via the content and not the rewrite. Since you are using Joomla this can be easily achieved by using various plugins that allow you to manually set the formatting of the URLS via rewrite and it'll add the canonical links to your dymanic content.

You can use SH404SEF to do this as well as many others on Joomla's vast plugin library that you can explore, other methods include editing the template files and adding custom code to do this but of course you'd need to learn the Joomla handles in order to do so. If you want more in depth information then I recommend you ask your question on the Beta Joomla Stack or the official Joomla Forums.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.