core icon indicating copy to clipboard operation
core copied to clipboard

get 403 error on Heroku server

Open meko3 opened this issue 4 years ago • 1 comments

Hi, I want to use flightPHP on Heroku. But I got 403 Error on Heroku. on Local server, this code went well.

Is This problem because of my code or because of Heroku server?

Here is code.

Procfile

web: vendor/bin/heroku-php-apache2 src/

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
<?php
require 'vendor/autoload.php';

Flight::set("layout", "templates/Layout");

Flight::route("/", function() {
    Flight::render("templates/head", array("style" => "front"), "head_content");
    Flight::render("templates/header", null, "header_content");
    Flight::render("pages/front", null, "body_content");
    Flight::render("templates/footer", null, "footer_content");
    Flight::render(Flight::get("layout"));
});

Flight::start();

Structure

.git
src
  |-views
    |-templates
  |-.htaccess
  |-Index.PHP
.gitignore
composer.json
composer.lock
Procfile

meko3 avatar Jun 22 '21 04:06 meko3

Did you try uploading and viewing an image or another simple file on that server?

A 403 is possibly that the server or apache config isn't allowing external requests.

magikstm avatar Jun 22 '21 04:06 magikstm

@meko3 still actual?

krmu avatar Jan 12 '24 19:01 krmu