Mobile app version of vmapp.org
Login or Join
Courtney195

: Http header rel=“canonical” through htaccess for dynamic content 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

@Courtney195

Posted in: #Apache #Htaccess #Joomla3 #Php

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Courtney195

1 Comments

Sorted by latest first Latest Oldest Best

 

@Turnbaugh106

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme