Php 您提交的URI不允许在nginx上使用字符codeigniter
当我在codeigniter中使用查询字符串时,它抛出以下错误:Php 您提交的URI不允许在nginx上使用字符codeigniter,php,.htaccess,codeigniter,nginx,Php,.htaccess,Codeigniter,Nginx,当我在codeigniter中使用查询字符串时,它抛出以下错误: The URI you submitted has disallowed characters. 当我使用apache时,它很好。但是在我将项目转移到nginx之后,我遇到了这个问题。 这是我在apache上的.htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #Removes access to the sy
The URI you submitted has disallowed characters.
当我使用apache时,它很好。但是在我将项目转移到nginx之后,我遇到了这个问题。这是我在apache上的.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 index.php
</IfModule>
但是你想提交什么URI?@IgnacioVazquez Abrams,“example.com/category”很好,“example.com/category?name=test”不好。htaccess:
RewriteRule^(.+)/?$index.php/$1[L]
你能解释一下index.php?/$1
的用途吗?我不知道,我是在互联网上找到的。我讨厌。你要提交的表格有问题。检查表单数据(在网络面板->检查请求中作为数据发送到服务器的内容),但您要提交的URI是什么?@IgnacioVazquez Abrams,“example.com/category”很好,“example.com/category?name=test”不是fineMy.htaccess:RewriteRule^(+)/?$index.php/$1[L]
你能解释一下index.php吗?/$1
是用来做什么的吗?我不知道,我在网上找到的。我讨厌。你要提交的表格有问题。检查表单数据(在网络面板->检查请求中作为数据发送到服务器的内容)
server {
listen 80;
access_log /var/log/nginx/access.example.com.log;
error_log /var/log/nginx/error.example.com.log;
server_name example.com;
root /home/example/public_html;
index index.php index.html index.htm;
error_page 404 index.php;
location / {
rewrite ^system.* /index.php?/$1 break;
rewrite ^application.* /index.php?/$1 break;
if (!-e $request_filename){
rewrite ^/([^.]*)$ /index.php?/$1 break;
}
proxy_pass http://localhost:8181;
include proxy.inc;
}
}