Skip to content

Commit

Permalink
Add the preview of Glue (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
BirnadinErick authored Feb 16, 2024
2 parents 57c4a74 + 106c1d6 commit 3ddb63f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<IfModule mod_rewrite.c>
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]
</IfModule>

13 changes: 13 additions & 0 deletions docs/4-glue-php-astro.md
Original file line number Diff line number Diff line change
@@ -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**

0 comments on commit 3ddb63f

Please sign in to comment.