concrete/src/Application/Application.php
public function handleURLSlashes(SymfonyRequest $request, Site $site)
    {
        $path = $request->getPathInfo();
        // If this isn't the homepage
        if ($path && $path != '/') {
            $config = $this->make('config');
            $trailing_slashes = $config->get('concrete.seo.trailing_slash');
            // If the trailing slash doesn't match the config, return a redirect response
            if (($trailing_slashes && substr($path, -1) != '/') ||
                (!$trailing_slashes && substr($path, -1) == '/')) {
                $parsed_url = Url::createFromUrl($request->getUri(),
                $trailing_slashes ? Url::TRAILING_SLASHES_ENABLED : Url::TRAILING_SLASHES_DISABLED);

                $response = new RedirectResponse($parsed_url, 301);
                $response->setRequest($request);

                return $response;
            }
        }
    }
public function handleURLSlashes(SymfonyRequest $request, Site $site)
    {
        $path = $request->getPathInfo();
        // If this isn't the homepage
        if ($path && $path != '/') {
            $config = $this->make('config');
            $trailing_slashes = $config->get('concrete.seo.trailing_slash');
            // If the trailing slash doesn't match the config, return a redirect response
            if (($trailing_slashes && substr($path, -1) != '/') ||
                (!$trailing_slashes && substr($path, -1) == '/')) {
                $parsed_url = Url::createFromUrl($request->getUri(),
                $trailing_slashes ? Url::TRAILING_SLASHES_ENABLED : Url::TRAILING_SLASHES_DISABLED);

                $response = new RedirectResponse($parsed_url, 301);
                $response->setRequest($request);

                return $response;
            }
        }
    }
public function handleURLSlashes ( SymfonyRequest $ request , Site $ site ) { $ path = $ request -> getPathInfo ( ) ; // If this isn't the homepage if ( $ path && $ path != '/' ) { $ config = $ this -> make ( 'config' ) ; $ trailing_slashes = $ config -> get ( 'concrete.seo.trailing_slash' ) ; // If the trailing slash doesn't match the config, return a redirect response if ( ( $ trailing_slashes && substr ( $ path , - 1 ) != '/' ) || ( ! $ trailing_slashes && substr ( $ path , - 1 ) == '/' ) ) { $ parsed_url = Url :: createFromUrl ( $ request -> getUri ( ) , $ trailing_slashes ? Url :: TRAILING_SLASHES_ENABLED : Url :: TRAILING_SLASHES_DISABLED ) ; $ response = new RedirectResponse ( $ parsed_url , 301 ) ; $ response -> setRequest ( $ request ) ; return $ response ; } } }
Using the configuration value, determines whether we need to redirect to a URL with
a trailing slash or not.

@return \Concrete\Core\Routing\RedirectResponse
Using the configuration value determines whether we need to redirect to a URL with a trailing slash or not .