Welcome Guest, Not a member yet? Register   Sign In
url_suffix problem
#1

[eluser]Lima[/eluser]
I'm using CI 1.7 on Debian etch with Apache 2.0 and PHP 5.2.0

I was developed all page without url_suffix and every thing looks good.
here some url with blank url_suffix :
http://www.mysite.com/rpc/customer from function site_url('rpc/customer')
http://www.mysite.com/site/customer from function site_url('site/customer')

Then I used url_suffix with .html
all my url automatically changed like this :
http://www.mysite.com/rpc/customer.html from function site_url('rpc/customer')
http://www.mysite.com/site/customer.html from function site_url('site/customer')

And my problem is
url http://www.mysite.com/rpc/customer.html return 404 Page Not Found
but http://www.mysite.com/rpc/customer looks good.

Then used url_suffix with _html and everything looks good.

back using url_suffix with .html
Then I try to debug CI_URI class on system/library/URI.php
original function is
Code:
function _remove_url_suffix()
{
  if  ($this->config->item('url_suffix') != "")
  {
    $this->uri_string = reg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string);
  }
}

for debugging I modify the function like this :
Code:
function _remove_url_suffix()
{
  if  ($this->config->item('url_suffix') != "")
  {
    echo $this->uri_string;
    $this->uri_string = reg_replace("|".preg_quote($this->config->item('url_suffix'))."$|", "", $this->uri_string);
  }
}

$this->uri_string result is /site/command_html not /site/command.html

so I modify the function like this :
Code:
function _remove_url_suffix()
{
  if  ($this->config->item('url_suffix') != "")
  {
  $this->uri_string = preg_replace("|".preg_quote(str_replace('.','_',$this->config->item('url_suffix')))."$|", "", $this->uri_string);
  }
}

so it solved my problem.

is anything wrong with my apache or php or CI configuration?


Messages In This Thread
url_suffix problem - by El Forum - 12-21-2008, 05:15 AM
url_suffix problem - by El Forum - 12-21-2008, 05:50 AM
url_suffix problem - by El Forum - 04-28-2009, 11:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB