Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7178579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:56:58+00:00 2026-05-28T16:56:58+00:00

We run a website that has an English version in the root directory http://www.mywebsite.com

  • 0

We run a website that has an English version in the root directory http://www.mywebsite.com and a Czech version in a folder called ‘cs’ http://www.mywebsite.com/cs

With our previous website we handled both language versions in the root directory, but with English files as standard filenames (eg: index.php) and Czech files with an addition _cz appended to the filename (eg: index_.php. We then had two flag buttons at the top of the website so each language version of each specific page could be called on, the relevant part of the header code is this:

href="http://www.mywebsite.cz<?php echo str_replace('.', '_cz.', $_SERVER['PHP_SELF']);?>"
href="http://www.mywebsite.com<?php echo str_replace('_cz.', '.', $_SERVER['PHP_SELF']);?>"

So that’s the background. Our new website has pages created dynamically using CodeIgniter. We need to modify the above code so that when a user is on an English page (eg: http://www.mywebsite.com/home/signup) for the Czech flag button to show http://www.mywebsite.com/cs/home/signup

And then vice versa for the Czech pages – the cs/ will be removed from URL. Can you help by modifying the above code in a similar way to the original operation? Many thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:56:59+00:00Added an answer on May 28, 2026 at 4:56 pm
    <?php        
    $path = str_replace('/cs/','',$_SERVER['REQUEST_URI']);    
    $cz_url = 'http://mywebsite.com/cs/'.$path; 
    $en_url = 'http://mywebsite.com'.$path; 
    ?>
    

    Update

    If i understand correctly what you mean, maybe something like :

    <a href="http://mywebsite.com/cs<?php echo trim(str_replace('/cs/','',$_SERVER['REQUEST_URI']),'/'); ?>">Czech</a> 
    <a href="http://mywebsite.com/<?php echo trim(str_replace('/cs/','',$_SERVER['REQUEST_URI']),'/'); ?>">English</a> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I run a social networking / blogging website ( http://www.obsidianportal.com ), and currently the
There is a website called Gild.com that has different coding puzzles/challenges for users to
I have a website that has images with urls like this: http://mysite.com/image1.jpg My server
I run (and am presently completely overhauling) a website that deals with theater (njtheater.com
I'm starting to develop a mobile version of a website that we run. Our
Ok, we run a website that has a shopping cart. Here's the scenario: a
I am developing a simple ASP.NET website that will run on the intranet on
Can I make my own jabber server.So that if I run my website xyz
I have a real estate website that has several categories. And i want the
I'm working on an existing custom control for an existing website that has to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.