Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 将htaccess规则路由路径转换为index.php到nginx_Apache_.htaccess_Nginx - Fatal编程技术网

Apache 将htaccess规则路由路径转换为index.php到nginx

Apache 将htaccess规则路由路径转换为index.php到nginx,apache,.htaccess,nginx,Apache,.htaccess,Nginx,我不熟悉nginx,但我正在尝试转换 # Disallows file browsing Options -Indexes # Custom Error Pages ErrorDocument 403 /error-docs/403.php ErrorDocument 404 /error-docs/404.php ErrorDocument 500 /error-docs/500.php # Turn on the Apache Rewrite Engine RewriteEngine On

我不熟悉nginx,但我正在尝试转换

# Disallows file browsing
Options -Indexes
# Custom Error Pages
ErrorDocument 403 /error-docs/403.php
ErrorDocument 404 /error-docs/404.php
ErrorDocument 500 /error-docs/500.php
# Turn on the Apache Rewrite Engine
RewriteEngine On
#Conditional to see if it is a real file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# If not then pass the query string to index.php and stop any further rules
RewriteRule (.*) index.php/$1 [PT,L]

到nginx语法。我已经尝试过这个建议,但它并不完全符合我的需要。我也试过自动转换器,但它们输出的规则对我也不起作用。非常感谢您的帮助。

我遇到的问题实际上与我的PHP和MySQL代码有关

location / {
    try_files $uri $uri/ /index.php$args;
}
很好。谢谢你的链接