URI路径不工作(多语种) [英] URI routing not working (multilingual)
问题描述
你怎么样?
摘要:我想将我的网站从本地主机到亚马逊EC2和的几乎的的任何途径带来的请求的URL示例.COM / XXX / YYY /在此服务器上找到。
背景:
- 在的public_html,应用程序和系统使用codeigniter结构。
- 在URI的Web语言。例如:本地主机/的public_html / ES /主
- 为了进行测试,一个页面(注册)它以不同方式传送:本地主机/的public_html /管理/注册。
- 在该网页的作品从本地主机。
问题: 我上传网页到我的EC2,当我尝试访问,几乎每一页显示404错误。刚刚的注册页的作品,但只有当我通过调用它的 example.com/index.php/admin/register 的( example.com/admin/register携带同样的404错误的)。
任何意见或想法,探索将是非常欢迎!谢谢!
PS:如果有帮助,我分享我目前routes.php文件code
。 $航线['default_controller'] =主;
$路线['404_override'] ='';
$航线['^(EN | ES)/(+)$'] =$ 2;
$航线['^(EN | ES)$'] = $航线['default_controller'];
这个问题是在httpd.conf,在那里设置AllowOverride针对的public_html(其中我有.htacces文件)被定为无。
我不得不将其更改为全部。
感谢AchrafSoltani和Grigorash的尝试,非常AP preciated!
How are you?
Summary: I'm trying to move my website from localhost to amazon-ec2 and almost any route brings "The requested URL example.com/xxx/yyy/ was not found on this server.
Context:
- Using codeigniter structure in public_html, applications and system.
- Web language in the URI. Example: localhost/public_html/es/main.
- For testing, one page (register) it's routed differently: localhost/public_html/admin/register.
- The page works from localhost.
Issue: I uploaded the page to my EC2, and when I try to access, almost every page shows the 404 error. Just register page works, but only if I call it via example.com/index.php/admin/register (example.com/admin/register carries the same 404 error).
Any advice or idea to explore would be very welcome!! Thanks!!
PS: In case it helps, I'm sharing my current routes.php code.
$route['default_controller'] = "main";
$route['404_override'] = '';
$route['^(en|es)/(.+)$'] = "$2";
$route['^(en|es)$'] = $route['default_controller'];
The issue was in the httpd.conf, where "AllowOverride" for public_html (where I had the .htacces file) was set at "None".
I just had to change it to All.
Thanks AchrafSoltani and Grigorash for the try, very appreciated!
这篇关于URI路径不工作(多语种)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!