Forum Moderators: phranque

Message Too Old, No Replies

Joomla index.php?lang=en handling + 301 redirect

How to handle Joomla CMS - JoomFish redirects

         

liborson

2:42 pm on Nov 19, 2007 (gmt 0)

10+ Year Member



Hello,
after spending countless hours on this and joomla forums, I am about to give up experimenting and ask you, the professionals.

I need to have a proper redirect for Joomlas multilanguage handling via Joomfish component via .htaccess:

Now, instead of:
[website.com...]

I need

[website.com...]

Any guru around to help, please?

jdMorgan

3:18 pm on Nov 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This thread, Changing Dynamic URLs to Static URLs [webmasterworld.com], should help get you started.

Jim

liborson

4:06 pm on Nov 19, 2007 (gmt 0)

10+ Year Member



Hello,
thanks for the link, already tried to figure it out. Not being programmer, I do have only plain HTML knowledge, I can not figure out how to make the rewrite rules...

Maybe someone else could help me out?

jdMorgan

10:22 pm on Nov 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We try to help you write your own code here -- That's one of the purposes of this forum. If you have specific questions about implementation, we'll be happy to help.

Jim

liborson

7:47 am on Nov 20, 2007 (gmt 0)

10+ Year Member



OK, no problem - here are my previous attempts - none of them works:

# RewriteRule ^(index.php?lang=en) /english.html [QSA,L]
# RewriteRule ^/index.php?lang=en /english.html [L]
# RewriteRule ^/index.php?lang=en [website.com...] [L]
# Redirect 301 /index.php?lang=en [website.com...]
# RewriteRule ^([^/]*)\.html$ /index.php?lang=$1 [L]
# RewriteRule ^index.php?lang=(.*)$ /english.html [L,R=301]

and I do have, of course, RewriteEngine on

Again, I am not a programmer, so copying others source and trying to apply it correctly is the most I can do.

Can anyone help, please?

liborson

11:31 am on Nov 21, 2007 (gmt 0)

10+ Year Member



OK,
seems like noone can help me with 301 redirects.... the other way around, in order to get rid of duplicated google issue, how do I block these pages in robots.txt?

Disallow /index.php?lang=en

does not seem to work.

Any ideas, please?

jdMorgan

3:07 pm on Nov 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This rule will redirect client requests for the dynamic "index.php?lang=en" URL-path to "www.example.com/english.html" without interfering with the internal rewrite that maps "/english.html" to "index.php?lang=en"

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?lang=en\ HTTP/
RewriteRule ^index\.php$ http://www.example.com/english.html [R=301,L]

The extra complication of the RewriteCond is necessary to prevent the redirect/rewrite "infinite" loop that would otherwise occur.

Our forum charter [webmasterworld.com] contains links to resources to help you learn the basics of mod_rewrite "programming" and regular expressions pattern-matching. Using mod_rewrite without understanding how it works can be quite dangerous to your site. So if you do not wish to learn about it, consider seeking professional assistance.

Jim

liborson

8:08 am on Nov 23, 2007 (gmt 0)

10+ Year Member



Dear jdMorgan,
thank you for your advice - not worked. Finally I made the seo component for joomla working again - by bombarding its authors. They issued a fix after couple of days.

Anyway, thank you for your help and resources!

jdMorgan

2:53 pm on Nov 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> ... I made the seo component for joomla working again - by bombarding its authors

That's really good news -- Many other Joomla users will be very grateful to you for being so persistant! :)

Jim

liborson

5:37 pm on Nov 23, 2007 (gmt 0)

10+ Year Member



To be frank - I was going mad by not able to figure out the error.

Finally, now it appears that no matter how .htaccess looked like, the joomla seo component had overwritten these rules by another error which has been produced AFTER parsing .htaccess.

Which all ends up in a simple end - never believe there is a simple solution. And never give up :))