title: laravel localization redirects me to mainURL/assets
body: <p>When I run main url in browser it takes to <code>mainURL/assets</code>. But When I put <code>mainURL/en</code> or <code>mainURL/bn</code>, it works fine. Without selecting &quot;/lang&quot; application shows 403 error.</p>
  <blockquote>
  <p>403 Forbidden</p>
  <p>nginx/1.4.6 (Ubuntu)</p>
  </blockquote>
  <p>Config/app.php</p>
  <pre><code> 'locale' =&gt; 'en',
   'locales' =&gt; ['en', 'bn','hi','zh','ja'],
   'fallback_locale' =&gt; 'en',
  </code></pre>
  <p>Helper method:</p>
  <pre><code>public static function switchLang($lang = 'bn')
      {
          $fullUrl = request()-&gt;url();
          $segments = request()-&gt;segments();
          $partSegment = implode('/', $segments);
  
          $domain = str_replace('/'.$partSegment, '', $fullUrl);
  
          $availableLang = config('app.locales');
  
          if(in_array($lang, $availableLang)) {
              $segments[0] = '/'.$lang;
              $newPartSegment = implode('/', $segments);
              return $domain.$newPartSegment;
          }
          return $fullUrl;
      }
  </code></pre>
  <p>view:</p>
  <pre><code> &lt;ul class=&quot;dropdown-menu&quot;&gt;
         &lt;li&gt;&lt;a href=&quot;{{ Helpers::switchLang() }}&quot;&gt; বাংলা &lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;{{ Helpers::switchLang('en') }}&quot;&gt; English &lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;{{ Helpers::switchLang('zh') }}&quot;&gt; 中國 &lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;{{ Helpers::switchLang('hi') }}&quot;&gt; हिंदी  &lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;{{ Helpers::switchLang('ja') }}&quot;&gt; 日本語 &lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  </code></pre>