- Posts: 15920
COMMUNITY FORUM
Help with SEO / Pagination
- Krikor Boghossian
-
- Offline
- Platinum Member
stackoverflow.com/questions/13624106/how-to-rewrite-joomla-pagination-to-friendly-url-with-htaccess
stackoverflow.com/questions/19440469/rewrite-joomla-pagination-sef-url-with-htaccess
Please Log in or Create an account to join the conversation.
- Joe Campbell
-
- Offline
- Platinum Member
- Posts: 438
1) I do not know Regex
2) Would such a modification have a negative impact on the rel next and previous links produced by ones SEF extension?
Please Log in or Create an account to join the conversation.
- Ioannis Toutoulis
-
- Offline
- New Member
- Posts: 8
Joe Campbell wrote: I am no developer, but I would think the code would look more like this...
$doc = JFactory::getDocument();
$pagdata = $this->pagination->getData();
if ($pagdata->next->link) {
$doc->addCustomTag('<link rel="next" href="'.$pagdata->next->link.'" />');
}
if ($pagdata->previous->link) {
$doc->addCustomTag('<link rel="prev" href="'.$pagdata->previous->link.'" />');
}
More on the subjectL
Google treats rel="previous" as a syntactic variant of rel="prev". Values can be either relative or absolute URLs (as allowed by the <link> tag). And, if you include a <base> link in your document, relative paths will resolve according to the base URL.
source: support.google.com/webmasters/answer/1663744?hl=en
No Joe, you don't have to write the code like that.
The addHeadLink method does the trick and gives the output as it should be.
Please Log in or Create an account to join the conversation.
- Joe Campbell
-
- Offline
- Platinum Member
- Posts: 438
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Joe Campbell
-
- Offline
- Platinum Member
- Posts: 438
The regex will modify the URL structure (URL in address bar), but what would you see if you reviewed the source code to view the meta data (canonical and rel previous/next)? Would the htaccess modification also change the meta data?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
However the link in the prev/ next links will display non-SEF links.
I do not know how this will affect your SEO in terms of double content.
I know this is a longshot but you ask how www.firecoders.com/extensions/route-66 handle paginated URLs.
Please Log in or Create an account to join the conversation.