Jump to content

[SOLVED] language change and seo url problem...


pfkdesign

Recommended Posts

hi everybody,

 

I'm developing a web site and i used htacces to generate url friendly, the web site is multilingual and i have problem to changing the language;

ex.

url : http://www.example.com/en/news/ or http://www.example.com/en/contents/21/some-contents/

 

now i want to change the language to deand the url must looks like:

url : http://www.example.com/de/news/ or http://www.example.com/de/contents/21/some-contents/ ....

 

on the page i have a menu with flags to change the language but i'm redirecting to root, i want to stay on that page and only change the language of that page, (not redirecting to root) :facewall:

 

any idea?

thank you in advanced.

 

I'm not sure the variables, can't be arsed to look them up but you can do this..

if $lang = "de"
header(Location: $_SERVER['SERVER_NAME'].'/de/'.$PATH.'/')
else if $lang = "en"
header(Location: $_SERVER['SERVER_NAME'].'/en/'.$PATH.'/')

 

like that, you'll have to find out the $path $_SERVER var.. if there is one..

 

You can also simply use str_replace/regex to replace '/en/' in the href.. not too hard.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.