1
votes

I am working with url segment, till now supplying 1 url segment is working perfectly. "http://doupnow.com/morevideo/downloaded" here "downloaded" is the parameter and "morevideo" is the method.

But now i am trying to pass 3 url segment. In this case its showing "page not found error"

I have done the following changes to achieve the same.

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

routes.php

$route['moreaudio/(:any)'] = 'home/moreaudio/$1';
$route['playaudio/(:any)/(:any)/(:any)'] = 'home/playaudio/$1/$2/$3';

1st route is working with 1 url segment.

Controller method

public function playaudio($aurl, $athumb, $atitle)
    {
        $result['aurl']=$aurl;
        $result['athumb']=$athumb;
        $result['atitle']=$atitle;
        $this->load->view('header');
        $this->load->view('audioplay', $result);
        $this->load->view('footer');

    }

view.php which is calling the url segment

<?php echo "<a href='playaudio/$row3->audio_url/$row3->audio_thumb/$row3->audio_title' target='_blank'>"; ?>

Please let me know where i am going wrong. Thank you.

1

1 Answers

0
votes

View ::

   <a href="<?php echo base_url('all/playaudio/audio_url/audio_thumb/audio_title');?>">Link</a>

Controller :

 public function playaudio()
{

    $result['aurl']   = $this->uri->segment('3');
    $result['athumb'] =  $this->uri->segment('4');
    $result['atitle'] =  $this->uri->segment('5');

    $this->load->view('header');
    $this->load->view('audioplay', $result);
    $this->load->view('footer');

}

.htaccess

 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php/$1 [L]