python - WSGIScriptAlias does but WSGIScriptAliasMatch DOES NOT regard DirectoryIndex -


this a.conf in /etc/httpd/conf.d/ rather edit httpd.conf work a.conf

namevirtualhost *:80   <virtualhost *:80> directoryindex 1 documentroot /a/b/ servername domain.tld wsgiscriptalias /1 /a/1.wsgi wsgiscriptalias /2 /a/2.wsgi </virtualhost> 

in example if go domain.tld via web..

wsgiscriptalias /1 /a/1.wsgi 

is automatically executed.

but let's rid of wsgiscriptalias , use wsgiscriptaliasmatch instead.

<virtualhost *:80> directoryindex 1 documentroot /a/b/ servername domain.tld wsgiscriptaliasmatch ^/(.*) /a/$1.wsgi </virtualhost> 

now.. when go domain.tld via web.. not see 1.wsgi instead default apache welcome page.

so looks like..

wsgiscriptaliasmatch ^/(.*) /a/$1.wsgi 

is not paying attention

directoryindex 1 

in other words via web domain.tld/1 works domain.tld not..

what causing ?

how

wsgiscriptalias /1 /a/1.wsgi 

can interpret domain.tld domain.tld/1 given directoryindex 1 but..

wsgiscriptaliasmatch ^/(.*) /a/$1.wsgi  

can not interpret domain.tld domain.tld/1 given directoryindex 1 ?

once solve issue plan on ensuring numbers 1 99 accepted , directed wsgi scripts.

in other words.. domain.tld/1 (index) domain.tld/99 point 99.wsgi

in other words understand (.*) might security issue.. first want solve issue of why.. directoryindex not being regarded.. wsgiscriptaliasmatch.. when regarded fine wsgiscriptalias

if fail solve problem.. have use perhaps 99 lines of..

wsgiscriptalias /1 /a/1.wsgi wsgiscriptalias /2 /a/2.wsgi wsgiscriptalias /3 /a/3.wsgi ... wsgiscriptalias /99 /a/99.wsgi 

in a.conf

which might less logical.

all because directoryindex not work wsgiscriptaliasmatch wsgiscriptalias

try:

wsgiscriptaliasmatch ^/(.+) /a/$1.wsgi 

you matching '/', , mapping '/a/.wsgi'. ensure there @ least 1 character after '/' , better still perhaps ensure numbers if scheme going use.

wsgiscriptaliasmatch ^/([1-9][0-9]*) /a/$1.wsgi 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -