• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in redirecting

#1
[eluser]mstdmstd[/eluser]
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 :

Code:
<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 :
Code:
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
Code:
( 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 ?

#2
[eluser]Massaki[/eluser]
Strange. Try removing the first slash
Code:
redirect( 'admin/facility/edit/' . $id );

#3
[eluser]mstdmstd[/eluser]
In case
Code:
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:
127.0.0.1 - - [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"
127.0.0.1 - - [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 :
Code:
<?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 :
Code:
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /_wwwroot/ci22    
    <Directory /_wwwroot/ci22>
      AllowOverride All
      Order Deny,Allow
      Allow from all
      Require all granted
    </Directory>
    
    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
</VirtualHost>
Can it be error in some configuration ?
I am under Kubuntu 14 :
Code:
$ 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 :
Code:
<a class="edit" href="admin/facility/edit/{$FacilitysList[row].id}{$PageParametersWithSort}">Edit</a>
works ok and in apache logs I see line :
Code:
127.0.0.1 - - [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"

#4
[eluser]mstdmstd[/eluser]
Seems problem was in $config['index_page'] = '-';


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.