-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
15 lines (15 loc) · 1.05 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
DirectoryIndex index.html index.php
RewriteEngine On
# Specify here the absolute path from the document root to the API root folder
RewriteBase /csw-4-web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Adds a trailing slash after serviceid param, if missing.
RewriteRule ^([a-zA-Z0-9\-]+)$ ./$1/ [R=301,L]
# Adds a trailing slash after resource, if missing.
RewriteRule ^([a-zA-Z0-9\-]+)/resource$ ./$1/resource/ [R=301,L]
# Maps the URI path to the URI query string submitted to the API.
#RewriteRule ^([a-zA-Z0-9\-]+)/(resource/((\?(.+))|(([^?][^.]+)(\.(.+))?))?)?$ ./?serviceid=$1&req=$2&itemid=$7&format=$9&$5&&%{QUERY_STRING} [NC,PT]
#RewriteRule ^([a-zA-Z0-9\-]+)/(resource/(([^?][^.]+)(\.(.+))?)?)?$ ./?serviceid=$1&req=$2&itemid=$4&format=$6&%{QUERY_STRING} [NC,PT]
#RewriteRule ^([a-zA-Z0-9\-]+)/(resource/(([^?][^.]+))?)?(\.(.+))?$ ./?serviceid=$1&req=$2&itemid=$4&format=$6&%{QUERY_STRING} [NC,PT]
RewriteRule ^([a-zA-Z0-9\-]+)/(resource/([a-zA-Z0-9\-_%:]+)?)?(\.(.+))?$ ./?serviceid=$1&req=$2&itemid=$3&format=$5&%{QUERY_STRING} [NC,PT]