Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Submitting data reloads the current page
    • There is an issue with your web.config file. Try the following web.config file:

      Code Block
      <?xml version="1.0"?>
      <configuration>
         <system.webServer>
            <rewrite>
               <rules>
                  <rule name="Main Rule" stopProcessing="true">
                     <match url=".*" />
                     <conditions logicalGrouping="MatchAll">
                       <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                       <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                     </conditions>
                     <action type="Rewrite" url="index.php" />
                  </rule>
               </rules>
            </rewrite>
         </system.webServer>
      </configuration>

      Next, update /core/ServiceProviders/MinphpBridge.php and make the following change:

      Code Block
      // $htaccess = file_exists($rootWebDir . '.htaccess');
      $htaccess = true;


Nginx

  • For pretty URL's (without /index.php/ in every URI) you will need to add a custom Nginx configuration. For a community provided example configuration, please see https://www.blesta.com/forums/index.php?/topic/9320-nginx-config/ or use the following (recommended) configuration

    • Code Block
      # Redirect HTTP to HTTPS
      server {
      	listen 0.0.0.0:80 default_server ssl http2; # IPv4
          listen [::]:80 default_server ssl http2; # IPv6
      	server_name account.yourdomain.com; # Hostname	
      	return 301 https://$host$request_uri;
      
      }
      # Run Blesta on SSL
      server {
      	listen 0.0.0.0:443 default_server ssl http2; # IPv4
              listen [::]:443 default_server ssl http2; # IPv6
              server_name account.yourdomain.com; # Hostname
              root /var/www/account.yourdomain.com; # Installation directory
      	# SSL cert/key pair
              ssl_certificate /etc/ssl/certs/account.yourdomain.com.crt;
              ssl_certificate_key /etc/ssl/private/account.yourdomain.com.key;
      
      
      	# iFrame protection
              add_header X-Frame-Options SAMEORIGIN;
      
              location / {
                      try_files $uri /index.php;
                      rewrite ^(.*)/install\.php$ /$1/install/ redirect;
              }
      
              location = /index.php {
                      fastcgi_pass unix:/run/php/php7.3-fpm.sock; # PHP socket
                      fastcgi_param SCRIPT_FILENAME $document_root/index.php; # Blesta /index.php
                      fastcgi_param SCRIPT_NAME $fastcgi_script_name;
                      include fastcgi_params;
              }
      
              location ~ /\. {
                      log_not_found off;
                      return 404;
              }
      
              location ~* \.(php|pdt|txt)$ {
                      log_not_found off;
                      return 404;
              }
      }


  • Next, update /core/ServiceProviders/MinphpBridge.php and make the following change:

    Code Block
    // $htaccess = file_exists($rootWebDir . '.htaccess');
    $htaccess = true;


...