Regional subfolders setup (site.com/ru/, site.com/en/)

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    815

Regional Subfolders Setup (site.com/ru/, site.com/en/)

Regional subfolders — alternative to subdomains. site.com/ru/, site.com/en/, site.com/de/. All versions on one domain, simplifying DNS, SSL and link weight transfer. Google recommends this approach for most cases.

Nginx: Routing by Prefix

server {
    listen 443 ssl http2;
    server_name example.com;

    root /var/www/example.com/public;

    # Pass locale prefix to app
    location ~ ^/(ru|en|de|fr)(/.*)?$ {
        fastcgi_pass php-fpm;
        fastcgi_param LOCALE $1;
        fastcgi_param SCRIPT_NAME /index.php;
        include fastcgi_params;
    }

    # Redirect from root to default locale
    location = / {
        return 302 /ru/;
    }
}

Laravel: Routing with Locale Prefix

// routes/web.php
Route::group([
    'prefix'     => '{locale}',
    'where'      => ['locale' => 'ru|en|de|fr'],
    'middleware' => ['set.locale'],
], function () {
    Route::get('/',                 [HomeController::class, 'index'])->name('home');
    Route::get('/catalog',          [CatalogController::class, 'index'])->name('catalog');
    Route::get('/catalog/{slug}',   [ProductController::class, 'show'])->name('product');
    Route::get('/about',            [PageController::class, 'about'])->name('about');
});

// Redirect from / to /{locale}/
Route::get('/', function () {
    $locale = app(LocaleDetector::class)->detect();
    return redirect("/{$locale}/");
});

Middleware: Setting Locale

class SetLocaleFromPrefix
{
    public function handle(Request $request, Closure $next): Response
    {
        $locale = $request->route('locale') ?? config('app.locale');
        App::setLocale($locale);
        URL::defaults(['locale' => $locale]);  // for named routes
        return $next($request);
    }
}

URL Generation with Locale

// Generate: route('catalog', ['locale' => 'en'])
// → /en/catalog

// Convenient helper
function lroute(string $name, array $params = []): string
{
    return route($name, ['locale' => app()->getLocale(), ...$params]);
}

Sitemap with Regional URLs

<url>
    <loc>https://example.com/ru/catalog</loc>
    <xhtml:link rel="alternate" hreflang="ru" href="https://example.com/ru/catalog" />
    <xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/catalog" />
    <xhtml:link rel="alternate" hreflang="de" href="https://example.com/de/catalog" />
    <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/en/catalog" />
</url>

Timeline

Subfolders setup with routing, middleware and sitemap: 2–3 working days.