diff --git a/src/General/Main.coffee b/src/General/Main.coffee index d73262b81..36e2fa2f1 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -133,11 +133,17 @@ Main = ImageCommon.addControls video return - if Conf['Normalize URL'] and g.VIEW is 'thread' + if Conf['Normalize URL'] pathname = location.pathname.split /\/+/ - if pathname[2] isnt 'thread' or pathname.length > 4 - pathname[2] = 'thread' - history.replaceState null, '', "#{location.protocol}//#{location.host}#{pathname[0...4].join('/')}#{location.hash}" + switch g.VIEW + when 'thread' + pathname[2] = 'thread' + pathname = pathname[0...4] + when 'index' + pathname = pathname[0...3] + pathname = pathname.join '/' + if location.pathname isnt pathname + history.replaceState history.state, '', "#{location.protocol}//#{location.host}#{pathname}#{location.hash}" # c.time 'All initializations' for [name, feature] in Main.features