簡體   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