From b250755d0e5d937c3037865d4e5fbd3690316d67 Mon Sep 17 00:00:00 2001 From: Birnadin Erick <45619033+BirnadinErick@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:08:16 +0530 Subject: [PATCH 1/2] add preview of .htaccess file --- .htaccess | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..064ec6b --- /dev/null +++ b/.htaccess @@ -0,0 +1,13 @@ + + RewriteEngine On + + # Hackaround to combine astro with PHP + RewriteCond %{REQUEST_URI} ^/api/ + RewriteRule ^api/(.*)$ api/index.php?p=$1 [QSA,L] + + # If not api route, then deliver static contents + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.*)$ $1 [L] + + From 106c1d6397dc88b7919146b40fdf5f6f35379754 Mon Sep 17 00:00:00 2001 From: Birnadin Erick <45619033+BirnadinErick@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:12:49 +0530 Subject: [PATCH 2/2] feat: add glue documentation --- docs/4-glue-php-astro.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/4-glue-php-astro.md diff --git a/docs/4-glue-php-astro.md b/docs/4-glue-php-astro.md new file mode 100644 index 0000000..24ada6d --- /dev/null +++ b/docs/4-glue-php-astro.md @@ -0,0 +1,13 @@ +## How glue works? + +As discussed above, the project incoperates both PHP and astro. +I accomplished this with `.htaccess` and playing with *Apache2* +configuration. + +As of this commit(check file's commit hash), the project requires +a special directory structure of the webroot... + +- a directory with name `/api` and contains all the PHP stuff +- root directory is then populated with astro build artifacts. + +> refer .htaccess file for logic of the **glue** \ No newline at end of file