Mobile version redirects non-sef url to index.php

vbarlakoski
11 years, 6 months ago
Hello!

I have an auto tweet plugin, which compiles link to article in non-sef format.

If i click on that link while i am on mobile, it redirects me to mobile version of site but on index.php not to specific article.

Why MobileJoomla does not accepts non-sef urls?

Thanks!


*** EDIT ***

In fact, it works with non-sef URL if its mobile non-sef link, but if the mobile user clicks on non-sef link that is for full version of website, it redirects to mobile version first (subdomain), cut other stuff of link, and puts only index.php.
Tomshaski
10 years, 8 months ago
Hi vbarlakoski . There are a lot of problems like this on Joomla , but I'm sure it doesn't hurt you website SEO .
vbarlakoski
10 years, 8 months ago
Well, if its not working as it should, it not hurts but it doesn't helps either

 
<?php
if(JFactory::getConfig()->getValue('config.sef')==1) {
  $app =& JFactory::getApplication();
  $uri = strtolower(substr(str_replace(JURI::base(),"",JURI::getInstance()->tostring()),0,21));
  if($uri=="index.php?option=com_")
  $app->redirect(JRoute::_(str_replace(JURI::base(),"",JURI::getInstance()->tostring())));
}
?>
 


Insert this on the top of template's index.php and its gonna be ok. I forgot to update this post after i found solution.
congluxi
10 years, 6 months ago
Good post. Thank vbarlakoski. I need it

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.