skip to Main Content

I am not good in English so consider my grammatical mistake.

I am from Bangladesh so my client wants Bangla URL for SEO friendly. I tried to passing some particulars Unicode word in URL.

Normally everything is ok but when I pass this ‘অর্থনীতি’ types of word browser show object not found. I used url_encode/url_decode, permitted_uri_chars, and more other suggestion too but this browser message is same. can I pass this types of word in the URL?

I attached two picture. one is URL working fine and another is not working well.

enter image description here

**** Solution ****

<IfModule mod_rewrite.c> 
   RewriteEngine On 
   RewriteBase /example3/ 
   RewriteCond %{REQUEST_FILENAME} !-f 
   RewriteCond %{REQUEST_FILENAME} !-d 
   RewriteRule . /example3/index.php [L] 
</IfModule>

2

Answers


  1. first of all make sure you enable query string in config.php file

    $config['enable_query_strings'] = TRUE;
    
    Login or Signup to reply.
  2. Here you have to change your controller function.

    public function news_details($news_id, $news_slug)
    {
    $data = array();
    $data['news'] = $this->WelcomeModel->full_news($news_id);
    $this->load->view('full-news', $data);
    }
    

    You just need to add this parameter $news_slug in your controller function

    Edit 1 :

    This is my function I tried :

    function news_details($id, $slug){
        print_r("News Id    : ". $id);
        print_r("<br>");
        print_r("News Slug  : ".$slug);
    }
    

    And this is what my output is :

    enter image description here

    Edit 2 :
    Second screenshot as per your provided string
    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search