Home page correct redirect

This forum talks about everything related to SEF/SEO extensions and Joom!Fish
Forum rules
When you use a 3rd party SEF extension, you need to turn off JFrouter. The SEF extension should take care of the routing of your URL's

First check if you are running the latest available versions of Joomla! (1.5.18), Joom!Fish (2.0.4) and the SEF extension you're having problems with.

We need the following at least (you can find this in your Joomla! backend under help > system info):

* Joomla! version
* Joom!Fish version
* SEF-Extension version
* PHP version (e.g. 5.2.5). Note: The support for PHP4 is discontinued.
* Web Server software (Apache or IIS with version number if possible)
* Server Operating system (e.g. Linux, Windows, Solaris, Darwin ...)
* Webserver to PHP interface
* Database version
* memory_limit from your phpinfo

Please enable error reporting and include any error messages in your posting.

Finally, please describe the steps required to recreate the problem and also please enable error reporting and give us any error messages generated.

Home page correct redirect

Postby dnsdesign on Mon Mar 01, 2010 12:03 am

Hello!
Here is my problem. I use two languages on my website. Russian (default) and English. All links looks like root/ru/xx.html and root/en/xx.html. All works fine except one thing. When i'm using En for browsing and press Home link in my menu, it redirects me on home page, but, as RU is default language, any page i will choose will be on russian. So how can i make some rule or something else so when i press Home using EN language for browsing and i will be redirected to root/en instead of root itself?

Technical info:
PHP Built on: Linux multi12.hostsila.com 2.6.9-89.0.11.ELsmp #1 SMP Tue Sep 15 07:08:59 EDT 2009 x86_64
Database Version: 5.0.89-community-log
Database Collation: utf8_general_ci
PHP Version: 5.2.9
Web Server: Apache
Web Server to PHP interface: cgi
Joomla! Version: Joomla! 1.5.14 Stable [ Wojmamni Ama Naiki ] 30-July-2009 23:00 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.16) Gecko/20080702 AdCentriaIM/1.7 Firefox/2.0.0.16 WebMoney Advisor MRA 5.5 (build 02842);

Joomla 1.5.14
Joomfish 2.03
sf404sef 1.5.6.398
dnsdesign
Newbee
 
Posts: 2
Joined: Sun Feb 28, 2010 11:53 pm

Re: Home page correct redirect

Postby dnsdesign on Mon Mar 01, 2010 10:49 am

viewtopic.php?f=38&t=1568
this helped a lot! thanks!

In modules/mod_mainmenu/helper.php on row 351, replace:
Code: Select all
$tmp->url = JURI::base();
to
Code: Select all
$tmp->url = str_replace(array($tmp->route.'/', $tmp->route), '', JRoute::_( $tmp->url ));

But fixed not all. Here is one little problem remains. I use splash screen that suggest user to choose which language will be displayed before entering site. So when he choose default site language he enters site like root/ru/ and no problem here. Problem is when he press RU flag again in language selection he will go to root instead of root/ru. When he choose EN language, he redirects to root/en/ and it is fine.

Any ideas?
dnsdesign
Newbee
 
Posts: 2
Joined: Sun Feb 28, 2010 11:53 pm

Re: Home page correct redirect

Postby goicon0211 on Tue Mar 15, 2011 2:11 pm

In my opinion,The best way to redirect those pages is by using "301 Redirect". It will redirects to a different page when activated.Not only does it carry your turn - make it safe.No need to worry about search engines penalize you for it. To be specific, the 301 redirect tells the browser, or in other cases, which tells the search engines "Hey this page has moved, here is the correct URL!"
goicon0211
Newbee
 
Posts: 1
Joined: Wed Mar 02, 2011 9:52 am

Re: Home page correct redirect

Postby ahmadalfy on Sun Oct 02, 2011 6:58 pm

I had the same issue but I used a different solution

I replaced
Code: Select all
$tmp->url = JURI::base();


with
Code: Select all
$tmp->url = JURI::base()."index.php";
ahmadalfy
Newbee
 
Posts: 14
Joined: Tue Dec 01, 2009 1:39 am


Return to Joom!Fish and SEF

Who is online

Users browsing this forum: No registered users and 1 guest