regex - Shorten URL using AliasMatch -


i'm able following configuration work:-

alias /webdoc /data/apps/jenkins/jobs  <directory /data/apps/jenkins/jobs/[a-za-z0-9\-]+/workspace/target/docco>   order allow,deny   allow </directory> 

with configuration, can make following url work

http://myserver/webdoc/hcms-js/workspace/target/docco/horizontal/index.html 

however, want shorten url this:-

http://myserver/webdoc/hcms-js/horizontal/index.html 

i tried following configuration, keep getting 404 when trying hit above link:-

aliasmatch ^/webdoc/([a-za-z0-9\-]+)/(.*) /data/apps/jenkins/jobs/$1/workspace/target/docco$2  <directory /data/apps/jenkins/jobs/[a-za-z0-9\-]+/workspace/target/docco>   order allow,deny   allow </directory> 

how work? thanks.

your aliasmatch lacks slash:

aliasmatch ^/webdoc/([a-za-z0-9\-]+)/(.*) 

the first match here hcms-js. second horizontal/index.html. means result be

/data/apps/jenkins/jobs/hcms-js/workspace/target/doccohorizontal/index.html 

so need change line

aliasmatch ^/webdoc/([a-za-z0-9\-]+)/(.*) /data/apps/jenkins/jobs/$1/workspace/target/docco/$2 

to insert slash didn't capture.

a first place these kinds of problems apache error log. should tell file can't find.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -