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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.