apache - Php encrypt url -
i need , using codeigniter php url encryption,
i use default codeigniter encryption class , without changing configuration,
but when encrypt url show me error
"object not found , request url not found on server"
the way encrypt url
$e_email_app = $this->encryption->encrypt($email_app); $e_email_app = urlencode($e_email_app); $newurl = base_url()."job_applicant/fill_data/".$e_email_app;
i enable apache mod_rewrite on http.conf , using virtual host this
<virtualhost *:83> serveradmin 192.168.77.204:83 documentroot "c:/xampp/htdocs/vacancy/public" <directory "c:/xampp/htdocs/vacancy/public"> options indexes followsymlinks includes execcgi allowoverride order allow,deny allow </directory> errorlog "logs/dummy-host2.example.com-error.log" customlog "logs/dummy-host2.example.com-access.log" common </virtualhost>
and .htacess
rewriteengine on
rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewritecond $1 !^(index\.php|css|images|robots\.txt) rewriterule ^(.*)$ ./index.php/$1 [l]
what should ? change encryption algorithm ? please help..
@george sazanovich : thx advise , no problem codeigniter, because fail success , , had setup encryption key
maybe apache url configuration ?
seems you're trying use reserved name ci_controller
$newurl = base_url()."controller/method/".$e_email_app;
or edited question , have real name controller , method? also, please, check encryption success:
$email_app = "test string"; $newurl = base_url("controller/method/".urlencode($this->encryption->encode($email_app))); $decoded = $this->encryption->decode(urldecode($newurl)); echo $decoded; // must "test string" after base_url()
and 1 more: using encryption library must set encyption key @ config file (application/config/config.php
-> $config['encryption_key']
).
if ok there's 1 reason break script: apache/codeigniter trims part of url. easiest way check - view what's recieved @ controller:
/* controller (for example mymail) defenition here */ // here's http://domain.com/mymail/mycheck/ public function mycheck($param){ var_dump($param); }
also, base_url()
accepts param,
base_url().'test/param';
equal base_url('test/param');
edit
i've checked string , seems illegal post "%2f
" @ get. problem in illegal characters @ encoded string (you can try use %2f encoded string , it'll crush app).
update
%2f urldecoded /
browser (such %20 (whitespace). browser thinks request
/controller/method/_encoded_string_/_part_after_%2f_
Comments
Post a Comment