From e806f53076babb0bd57deae70711b26ff77b498a Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Mon, 27 May 2019 23:51:28 -0600 Subject: [PATCH] Add original .htaccess file from Lexiconga --- package.json | 4 ++-- src/php/.htaccess | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/php/.htaccess diff --git a/package.json b/package.json index de02b76..43314bc 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "scripts": { "start": "concurrently \"npm run watch-js\" \"npm run watch-php\"", "watch-js": "parcel watch index.html view.html --public-url ./", - "watch-php": "cpx \"src/php/**/*\" dist -v -w", - "bundle": "parcel build index.html && cpx src/php/**/* dist", + "watch-php": "cpx \"src/php/**/{*,.*}\" dist -v -w", + "bundle": "parcel build index.html && cpx \"src/php/**/{*,.*}\" dist", "serve-frontend-only": "parcel index.html", "clear": "npm run clear-dist && npm run clear-cache", "clear-dist": "rimraf dist/*", diff --git a/src/php/.htaccess b/src/php/.htaccess new file mode 100644 index 0000000..790c499 --- /dev/null +++ b/src/php/.htaccess @@ -0,0 +1,13 @@ +RewriteEngine On # Turn on the rewriting engine + +RewriteRule ^view/([0-9]+)/([0-9]+)/?$ api/router.php?view=publicview&dict=$1&word=$2 [NC,L] # Handle word ids. + +RewriteRule ^([0-9]+)/([0-9]+)/?$ api/router.php?view=publicview&dict=$1&word=$2 [NC,L] # Handle word ids. + +RewriteRule ^view/([0-9]+)/?$ api/router.php?view=publicview&dict=$1 [NC,L] # Handle dictionary ids. + +RewriteRule ^([0-9]+)/?$ api/router.php?view=publicview&dict=$1 [NC,L] # Handle dictionary ids. + +#RewriteRule ^issues/?$ https://github.com/Alamantus/Lexiconga/issues [R=301,L] # Shorten issues url. + +#RewriteRule ^updates/?$ https://github.com/Alamantus/Lexiconga/releases [R=301,L] # Shorten updates url. \ No newline at end of file