繁体   English   中英

nginx url重写blesta

[英]nginx url rewrite blesta

有人可以帮我转换此网址重写

########################################################
# package:    minPHP
# filename:   .htaccess
########################################################

<Files ~ "\.(pdt)$">
   order deny,allow
   deny from all
</Files>

# Protect against Clickjacking
#Header append X-Frame-Options "SAMEORIGIN"

RewriteEngine on

# Force HTTPS
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php

RewriteCond %{REQUEST_URI} ^(.*)/install.php$
RewriteRule install.php %1/install/ [R=301,L]

这是我们当前的重写,可以正常工作,但有一些错误。 如/index.php/仍应位于/ client / login的链接中,并且某些页面会强制您下载标记为“下载”的文件

# Disallow access to any file with .pdt extension
  location ~ (\.pdt) {
    return 403;
  }

  location / {
  error_page     404 = @blesta; #IF file doesn't exist
  log_not_found  off;

  rewrite ^(.*)$ /index.php last;

  # For access to install file
  if ($request_uri ~ "^(.*)/install.php$"){
    rewrite install.php /%1/install/ redirect;
   }
  }

Nginx的blesta重写规则:
https://github.com/cloudrck/blesta-nginx/blob/master/sites-available/blestav3

如何在网址中删除/index.php/:

编辑lib / init.php,更改:

define("HTACCESS", file_exists(ROOTWEBDIR . ".htaccess"));

至:

define("HTACCESS", true);

参考: http : //docs.blesta.com/display/user/Installing+Blesta#InstallingBlesta-SystemConfiguration

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM