I am deploying on linux apache hosting angular frontend and php slim app framework backend.
In localhost I have on localhost:4200 angular and localhost:80 in xampp apache php
and the path worked
now I have www.mydomain.org/ .(all deployed angular ) .(.htaccess) .folder (slimapp )*php
inside folder I have :
- Public
- index.php
- src
- config
- db.php
- routes
- event.php,login.php,user.php
- config
.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html
# to allow html5 state links
RewriteRule ^ index.html [L]
index.php
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS');
header('Access-Control-Allow-Headers: token, Content-Type');
require_once '../vendor/autoload.php';
require_once '../slimapp/src/config/db.php';
// Customer Routes
$app = new \Slim\App;
require_once "../slimapp/src/routes/user.php";
require_once "../slimapp/src/routes/login.php";
require_once "../slimapp/src/routes/event.php";
$app->run();
My question is, I can not understand how link all path together.
Because Angular, needs that .htaccess cause without not works refresh page I tried in all different ways but is only works, so I need that on index.html
But now works refresh but I can't use php backend.
How can I use it, I need edit .htaccess, where index.php have to be on path?
Considering that for example api rest : slimapp/event is in my pc thanks to apache settings and file host localhost/slimapp/public/index.html/event (is a get call that retrieve event from db)
How need to be new path? in real domain?