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
|
||||
}
|
||||
|
||||
if(! ~ $args '') {
|
||||
if(~ $args($#args) 'index')
|
||||
perm_redirect `{echo $req_path | sed 's,/index$,/,'}
|
||||
|
||||
pageTitle=`{echo $args | sed -e 's/ / - /g' -e 's/_/ /g'}
|
||||
}
|
||||
if(! ~ $#args 0)
|
||||
pageTitle=`{ echo $args|sed -e 's/ / - /g' -e 's/_/ /g' }
|
||||
|
||||
if(~ $req_path '/index')
|
||||
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=()
|
||||
cd $sitedir
|
||||
|
|
@ -231,13 +235,6 @@ if(~ $pageTitle '')
|
|||
if not
|
||||
pageTitle=$"pageTitle^' | '^$"siteTitle^' '^$"siteSubTitle
|
||||
|
||||
|
||||
if(test -d $local_path) {
|
||||
if(! ~ $local_path */)
|
||||
perm_redirect $req_path^'/'
|
||||
local_path=$local_path^'index'
|
||||
}
|
||||
|
||||
select_handler
|
||||
|
||||
if(! ~ $#debug 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue