我的网址中有阿拉伯语字符,例如http://localhost/Mypro/ar/flights/رخيص-هواء-تذاكر-البحرين-إلى-مومباي-بوم-باه
,因此我将其路由到某个方法。当我加载此网址时,出现错误:
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.39 (Win64) OpenSSL/1.1.1b PHP/7.2.18.
任何人都可以帮助我解决此问题。
config \ route.php
$path = urlencode('الرخيصة من الجو تذاكر - (: وجدت) -to - (: أي) - (: أي) - (: وجدت)');
$route['^(en|ar)/'.$path] = "Seo/viewCities";
config \ config.php
$config['permitted_uri_chars'] .= '%D8%A2%D8%A7%D8%A8%D9%BE%D8%AA%D8%AB%D8%AC%DA%86%D8%AD%D8%AE%D8%AF%D8%B0%D8%B1%D8%B2%D8%B3%D8%B4%D8%B5%D8%B6%D8%B7%D8%B8%D8%B9%D8%BA%D9%81%D9%82%DA%A9%DA%AF%D9%84%D9%85%D9%86%D9%88%D9%87%DB%8C%D9%8A%DB%B1%DB%B2%DB%B3%DB%B4%DB%B5%DB%B6%DB%B7%DB%B8%DB%B9%DB%B0';
system \ core \ uri.php
public function filter_uri(&$str)
{
if (!preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str))
{
show_error('The URI you submitted has disallowed characters.', 400);
}
}
答案 0 :(得分:0)
这段代码可能会有所帮助
$(document).ready(function(){
$("#plot").bind("click", function(event){
alert(event.offsetX + ", " + event.offsetY);
})
});
// $直到您对网址不屑一顾
这对我有用:)