Simplify and optimize some of the canonical-url-redirections.
This commit is contained in:
parent
2b29543b68
commit
518f2f9685
1 changed files with 10 additions and 13 deletions
23
bin/werc.rc
23
bin/werc.rc
|
|
@ -192,12 +192,16 @@ if(~ $REQUEST_METHOD POST) {
|
||||||
login_user
|
login_user
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! ~ $args '') {
|
if(! ~ $#args 0)
|
||||||
if(~ $args($#args) 'index')
|
pageTitle=`{ echo $args|sed -e 's/ / - /g' -e 's/_/ /g' }
|
||||||
perm_redirect `{echo $req_path | sed 's,/index$,/,'}
|
|
||||||
|
if(~ $req_path '/index')
|
||||||
pageTitle=`{echo $args | sed -e 's/ / - /g' -e 's/_/ /g'}
|
perm_redirect `{echo $req_path | sed 's,/index$,/,'}
|
||||||
}
|
|
||||||
|
if(~ $local_path */)
|
||||||
|
local_path=$local_path^'index'
|
||||||
|
if not if(test -d $local_path)
|
||||||
|
perm_redirect $req_path^'/'
|
||||||
|
|
||||||
p=()
|
p=()
|
||||||
cd $sitedir
|
cd $sitedir
|
||||||
|
|
@ -231,13 +235,6 @@ if(~ $pageTitle '')
|
||||||
if not
|
if not
|
||||||
pageTitle=$"pageTitle^' | '^$"siteTitle^' '^$"siteSubTitle
|
pageTitle=$"pageTitle^' | '^$"siteTitle^' '^$"siteSubTitle
|
||||||
|
|
||||||
|
|
||||||
if(test -d $local_path) {
|
|
||||||
if(! ~ $local_path */)
|
|
||||||
perm_redirect $req_path^'/'
|
|
||||||
local_path=$local_path^'index'
|
|
||||||
}
|
|
||||||
|
|
||||||
select_handler
|
select_handler
|
||||||
|
|
||||||
if(! ~ $#debug 0)
|
if(! ~ $#debug 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue