Welcome Guest, Not a member yet? Register   Sign In
Error in redirecting

Hi All,
I have rather a strange problem:
I have a page with http://local-ci22.com/admin/facility/edit/4 url and it is submitted at itself having form definition :

<form class="form-horizontal" action="/admin/facility/edit/4/page/1" method="post" accept-charset="utf-8" id="form_facility_edit"  name="form_facility_edit" enctype="multipart/form-data">
                                    <input type="hidden" name="csrf_test_name" value="697bb78af9556557cf554cae7a615fc7" />

I save the data and want to make redirect at sime page with code like :
redirect( '/admin/facility/edit/' . $id );

But page is redirected at url http://local-ci22.com/-/admin/facility/edit/4/page/1 and I can not find where "-/" is from in rederecting url ?

If redirect with code like
( base_url() . 'admin/facility/edit/' . $id );
it works ok.
Is it some error redirect function of maybe error in config file?
While relative urls are invalid ?
Which config items are used here ?

Strange. Try removing the first slash
redirect( 'admin/facility/edit/' . $id );

In case
redirect( 'admin/facility/edit/' . $id );
resulting url is the same http://local-ci22.com/-/admin/facility/edit/5/page/1

In apache log I see rows:
Code: - - [28/Aug/2014:07:15:59 +0300] "POST /admin/facility/edit/5/page/1 HTTP/1.1" 302 3727 "http://local-ci22.com/admin/facility/edit/5/page/1" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0" - - [28/Aug/2014:07:15:59 +0300] "GET /-/admin/facility/edit/5/page/1 HTTP/1.1" 200 8904 "http://local-ci22.com/admin/facility/edit/5/page/1" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0"
In my application/config/routes.php :
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$route['default_controller'] = "main";
//$route['404_override'] = '';*/
$route['about_us'] = 'main/cms_page/about_us';
$route['contact_us'] = 'main/cms_page/contact_us';
$route['security_privacy'] = 'main/cms_page/security_privacy';
$route['terms_condition'] = 'main/cms_page/terms_condition';
$route['travel_insurance'] = 'main/cms_page/travel_insurance';
$route['register'] = 'main/register';
$route['hostel/:any'] = 'hostels/hostel';
$route['tour/:any'] = 'tours/tour';

$route['cron/tour-subscription'] = "cron/tour_subscription";

$route['404_override'] = 'main/invalid_url';

/* End of file routes.php */
/* Location: ./application/config/routes.php */

Hosting definition in local-ci22.com.conf :
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /_wwwroot/ci22    
    <Directory /_wwwroot/ci22>
      AllowOverride All
      Order Deny,Allow
      Allow from all
      Require all granted
    ServerName local-ci22.com
    ServerAlias local-ci22.com

    Options FollowSymLinks
    DirectoryIndex index.php
    ErrorLog /_wwwroot/ci22/log/error.log
    CustomLog /_wwwroot/ci22/log/access.log combined
Can it be error in some configuration ?
I am under Kubuntu 14 :
$ uname -a
Linux serge-System-Product-Name 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014 i686 athlon i686 GNU/Linux

Also usual relative links in smarty defined as :
<a class="edit" href="admin/facility/edit/{$FacilitysList[row].id}{$PageParametersWithSort}">Edit</a>
works ok and in apache logs I see line :
Code: - - [28/Aug/2014:07:27:47 +0300] "GET /admin/facility/edit/5/page/1 HTTP/1.1" 200 9934 "http://local-ci22.com/admin/facility/index/page/1" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0"

Seems problem was in $config['index_page'] = '-';

Theme © iAndrew 2016 - Forum software by © MyBB